How to generate "requirement.txt" file for robot framework project - selenium

I have a API test automation project that is written using robot framework and I wanted to generate the requirement.txt file for this project.
I've tried below two options and having below issues.
pipreqs - This will only include the requirements for python libraries that are added in the project. Libraries for the .robot files are not getting included.
pip freeze > requirements.txt - This will add all the libraries that are installed on my PC. I just need the required libraries only.
Can someone help me with this.

You should repeat those procedures in a virtualenv. You will need to install Robot Framework and the libraries you need for your tests. Do a test run and then the pip freeze will show only the modules you installed.

Related

Is there a way to introduce a preinstall step like the one in npm for installing deno packages in a deno project?

So npm allows a preinstall script to run before installing a module. For example, puppeteer uses this step to install headless chrome. Is there any way to do something like this with deno?
Unlike Node.js, Deno has no package manager. Instead of installing packages, all modules and dependencies are simply cached as static files for use at runtime — there is no configurable hook for an "installation step". Any code which requires an external dependency (such as a coordinating process in the case of Puppeteer) must ensure that such a dependency exists at runtime using program code. See Creating a Subprocess in the manual.
See also section 3.1 of the manual Basics > Modules for information about the module system.
For an example of a Puppeteer implementation in Deno, see https://deno.land/x/puppeteer (source GitHub repo).

How do I correctly work with multiple dependent packages in IntelliJ IDEA?

I've got three packages in my project.
Two of the packages I'm working on are dependencies for the 'main' package.
These two are installed in development mode within the project's virtual env (by the pip install -e).
They are imported as modules in the IntelliJ IDEA project (currently highlighted as 'non-project files' in yellow).
My questions:
What is the correct way of setting it up?
Why are the packages in the venv showing as non-project files?
Thank you

Adding .jar Files in Visual Studio Code

First and foremost, I really appreciate your help. I am trying to build an application by using an external library Apachi Poi. I know I need to add jar files to the project; however, I don't know how I should do that plus I have been searching on the Internet for a solution, but I could not find one even I checked this. My OS is Linux and I am running 1.33.1 version of VSCode.
[UPDATE]: I have fixed my problem. What I basically did was to install maven command to my
Linux machine and now I am using mvn command along with pom.xml to add my .jar files to
the project.

How to generate 64-bit version of sikuli JAR?

I am working on developing test automation code in selenium, I want to use 'sikuli' inside my code to handle windows and Flash objects in my web application,
I'm using 64-bit JVM, but there is no 64-bit version of Sikuli available, this is resulting in an error while running the code,
"Can't load IA 32-bit .dll on a AMD 64-bit platform"
I could not find a 64-bit sikuli Jar on internet, but I found that Sikuli source code is hosted on GitHub, could someone help me understand if I can use that source code and compile it into a jar of 64 bit version?
I'm not sure if this is possible or not.
If you install Sikuli 1.0.1 you have the option to install 6 packages with it as well. I would recommend installing the first 5. Then you will have all the things you are ever going to use.
If you also work on different sytems other then Windows, the 6th packages is also advisable.
I have installed all 6.
Finally got this working, here is what I did,
Download the sikuli set-up Jar from
"https://launchpad.net/sikuli/sikulix/1.0.1/+download/sikuli-setup.jar"
Save this jar in a folder 'SikuliSetup',now create a sub directory
'Downloads' which will come into picture later.
Run the above Jar, this will generate two files under the above
directory.
Now run the 'runSetup.bat' file generated from above setup. This
will start the setup, now select the 4th and 6th option in the
'sikulisetup' pop-up and click on 'setup Now'.
The above step will fail for most people due to default security
issues.
If the above step fails then you need to download an offline
version of this jar from this URL
"https://launchpadlibrarian.net/156273987/Sukuli-1.0.1-Offline-Setup-Java-option3-option4.zip".
UnZip the above file and copy the '1.0.1-3.jar' file to 'Downloads'
directory created under the 'SikuliSetup' directory previously.
Now run the 'runSetup.bat' file again, this will generate a new
jar file 'sikuli-java' and its dependent libraries under 'lib'
folder.
That's it, now copy this jar 'sikuli-java.jar' to your java build
path in eclipse.
Now Java will use this sikuli libraries without any issues.
Once after you setup the jar file under build path, restart the
system and login again.

Using Jython with Maven

I have a Maven module, that depends on various other Maven dependencies by which I am accessing through my jython code.
I am now done, and I would like to compile the project as a .jar, or even just run it without compiling, but I have no clue where to start.
Does anyone have any idea how I can run some .py files that accesses some Java libraries in other packages?
Also, how can I compile it as a .jar file when all is done and good?
Thanks!
Compiling and integrating python
Use the jython-compile-maven-plugin. It allows you to deploy a standalone project that includes jython with libraries.
For demonstration of this plugin, see the demo project and its source code. It shows how to
launch a python console -- look at AbstractInitJython and InitJython on how to launch a python/jython console, how to execute python code snippets, and how to run a python script.
include python libraries -- the plugin also downloads and bundles python libraries (using easy_install) in the package phase, and adds them to the jar. The resulting jar can have all the libraries of the project, all pom dependencies and all the python libraries requested. The demo project shows this with the "nose" python library (see the pom file).
Testing python / jython code
The python-test-maven-plugin allows you to run your python tests alongside the normal junit tests. The demo project (look at the source at source code) shows the use of standard python unit tests (with nose) and BDD (behaviour testing) with the lettuce-clone freshen.
The sourceforge umbrella project is http://mavenjython.sourceforge.net/
Unlike maven-jython-plugin, they don't use the outdated jythonc compiler.
I am now done, and I would like to compile the project as a .jar,
It looks like there is a maven-jython-plugin allowing to compile jython source files to Java class files.
I've kinda figured out my answer to this. I shouldn't have tried to compile it, but instead wrap the python code with Java: http://jythonpodcast.hostjava.net/jythonbook/en/1.0/JythonAndJavaIntegration.html#using-jython-within-java-applications
The compiler portion of jython, jythonc, is deprecated as of 2.5 -- http://wiki.python.org/jython/ReplaceJythonc -- a replacement is in the works.