Location for install.rdf - selenium

I am trying to write a plug-in for selenium UI and following this tutorial. Below is an excerpt from this.
First, what you need is an ‘install.rdf’ file and is located in the
root dir of your workspace
I am not sure what is root directory of workspace here mean. So I have firefox and selenium installed on my computer. Where exactly should I create this install.rdf

The root directory mentioned here is the root directory of the IDE source code. You can download IDE src code from location given below and put the install.rdf in the root.
Selenium IDE src code
Once you have made changes to the plugin src as per your needs. You can build it and install the .xpi hence built to your firefox instance like a regular extension and test it.

Related

WebStorm run configuration - package.json path relative to project directory

Question: In WebStorm's npm run configuration: How to make the package.json path relative to project directory?
Goal: To be able to share the run configuration in VCS, it must not depend on where the project is on my machine.
Screenshot: I.e., I want to change ~\WebStormProjects\x-nest\ to PROJECT_DIR\.
package.json field doesn't support variables; but you do not need to use macros or do anything at all to make configurations shareable, this case is handled automatically: if you look inside the .idea/workspace.xml (or .idea\runConfigurations\<config name>.xml if Share through VCS is enabled for it) file you'll notice that IDE stores this path as $PROJECT_DIR$/path/to/package.json, like:
<package-json value="$PROJECT_DIR$/package.json" />
So you can safely keep this .xml file under Version Control and your colleagues will have the correct path to the file even if local path to project is different.

Selenium file download test case in Jenkins

I downloaded a file in one of my local folder(say CSV_downloads) using selenium and its working fine,but when I am pushing same code to Git and running it in jenkins,though that folder(CSV_downloads) exists in jenkins workspace(CSV_downloads) its not downloading csv to that particular folder(CSV_downloads) in jenkins.
If you use a hard coded location like C:\CSV_downloads then it will not be downloaded into jenkins folder. So you have to see the folder locations in local and remote machines.
Try to use relative paths like System.getProperty("user.dir") +"//folders.." where System.getProperty("user.dir") is your project folder.
also if the folder is not there then try to create directory like folderName.mkdirs();

Add chrome web driver in RIDE (robot framework)

I am new to robot framework.
I have put the chromedriver.exe file in the path of system. Now, when I am running scripts in RIDE I am getting this error:
WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
Is there is any other way of setting path in RIDE itself?
UPDATE: My path variable includes:
C:\Driver\chromedriver.exe;
As mentioned in the Robot framework installation guide,How to set the environment variables.
Place the chrome driver in te path "C:\Python\Scripts" and make sure this path "C:\Python\Scripts" is updated in environment variables.If you have any clarification check the below link.Under the heading Setting PATH on Windows
https://github.com/robotframework/robotframework/blob/master/INSTALL.rst
Download Chromedriver.exe from its official website, extract the .exe file and copy this .exe file in scripts folder of Python installation, e.g. C:\Python36\Scripts
After this, add this scripts path in Environment variable

Unable to mark a directory as test sources root in PyCharm

I was trying to mark a directory as test sources root in PyCharm so that I don't have to manually set the target directory for my generated test file every time. When I right-click my "tests" directory I only see the following four options:
Mark Directory As:
1. Source Root
2. Template Folder
3. Excluded
4. Resource Root
I remember doing this in Intellij for Java but is this not possible for PyCharm?
Do the following:
Mark the directory as "sources".
Close PyCharm.
Open the <project root>/.idea/<projectname>.iml file in a text editor.
Search for "isTestSource=" for the appropriate directories and change it from "false" to "true".
Reopen PyCharm.
To keep the UI simpler, the test source root configuration option is not exposed in the PyCharm UI.
In PyCharm 2017.1.3
From the tests toolbar, click edit configurations then you can set the working directory default, this will be used by each test on first run.
Hope this helps!

How to change the path that jar files use in java Web Applications

I have written a java Servlet web application, using NetBeans 7.2.1. The program have some jar file libraries that I have attached to the project. The application runs fine using NetBeans and Apache Tomcat 7.0.27.
My problem is that some of the jar file libraries that I am using in the project, need to access to some folders and files. I put these folder and files on the same directory as the whole NetBeans project is. but I got this exception:
Exception: java.lang.RuntimeException: java.io.FileNotFoundException
So I used these codes to find out where should I put them:
out.println("current directory: " + new File(".").getAbsolutePath());
out.println("current directory: " + System.getProperty("user.dir"));
out.println("current directory: " + getServletContext().getRealPath(("/")));
So I figured out that the current working directory is:
C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin
My question is that how can I set different directory address for each web application? I have many web applications and some of them use the same resource file names. I can't just put all of them in one directory.
Please note that I don't have access to the source code of jar files to change the. I just need a way to set the absolute path that the jar files use.
I have the same problem when I put the WAR file on the unix server. The extracted WAR file is in this location on the server:
/data02/tools/Apache/Tomcat/apache-tomcat-6.0.37/webapps/BANNEROnline
But I figure I should put the resource folders and files in this path (moosavi3 is my username!):
/home/moosavi3
How can I change the path?
The working directory is the directory from which java.[exe,bin] is started. I assume the bin directory is where the tomcat start-up script is? If the jars are all using this working directory I don't believe there is a way to make different web-apps have different working directory, they're all loaded on the same jvm (java.exe) from the same working directory.
A working directory is the directory from which a binary is started, it is not some arbitrary value that you can change.
I suspect these jar files where meant to be run as standalone applications and expected the filesystem resources they are trying to access to be in the same location as themselves.
Any filesystem resources would have to be moved to the location of your java.exe so that the correct file path resolution can result from your jars.
Standard Servlet project requires external libraries to be placed in the 'WEB-INF/lib' directory under project root. You can search google for 'servlet directory structure' and do your own research for more information. Shared libraries between web applications can be placed in the 'lib' directory under tomcat root, they should be picked up by tomcat jvm. My recommendation would be to keep the dependencies project specific, because you may need different versions in different projects in the future.
Update:
Read this page on the tomcat documentation, it will explain exactly how the project should be structured, and how to add a library that will be shared across all web applications:
http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html
Update 2:
The following Stackoverflow link explains several options how to add a static file to your web application, that will available at runtime.
https://stackoverflow.com/a/2161583/940754
Update 3:
Add a path to the classpath using the project's manifest:
http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html