installing selenium-java-2.5.0 in eclipse - java

I have downloaded "selenium-java-2.5.0" and added it to the build path of my project in eclipse, but when I try to utilize one of the new API's I get a syntax error.
Is there a tutorial for installing the selenium-java-2.5.0 in eclipse?

The issue was that old jars were still conflicting with eclipse, removed old jars re-added fresh ones

You will need all the .jar files in selenium ZIP. Copy selenium-java-2.xx.jar and all the jars from libs folder (in selenium ZIP) to your project.
If you really need a tutorial about this, look here: Selenium Java Tutorial

I would suggest create a pom.xml file and add the maven dependencies to the file and refresh the project. Then the required dependencies and jar are automatically installed. you can also add jar according to your requirement by going to the link.
https://mvnrepository.com/
because adding jar separately might lead to any flows.

If you want setup Selenium Environment,
1) Download and Install Java Software (JDK) - create and execute programs / Test scripts
2) Set Environment Variable path (Path Variable) - To use Java from any directory
3) Download Eclipse IDE and Extract - To write and execute Java Programs
4) Download Selenium WebDriver Java Language binding (from www.seleniumhq.org) and Add
Webdriver jar files to Java Project in Eclipse IdE
5) Download Browser driver/s and (* set browser driver path in Test cases...)

Related

Postgresql/Eclipse ERROR No suitable Driver found for jbdc [duplicate]

Ok I am on Win Vista and correctly set my MAVEN_HOME, JAVA_HOME stuff. but I do not have a class path yet. I have also installed MySQL. now I have opened a Hibernate book and at the very first pages it says "make sure the jdbc driver is in your classpath" . I have also downloaded some Zip file that is ConnectorJ or some name like that which is basically the mySql driver for java... but my problem for now is this sentence that I have no clue how to do it: "make sure the jdbc driver is in your classpath"
would you please help me about this classpath thing?
thanks
Here is a good tutorial regarding, setting the class path. Further you might like to read Managing the Java classpath (Windows).
Having said that, you should not set the classpath for your driver in Windows environment variable. Instead, you should include that driver jar inside your IDE under project properties. But I noticed that you are actually using Maven. In this case you should look for the driver under Maven in order to fulfil that dependency. Maven will download the driver jar, if doesn't exist, and make it local.
In case, you are not using any IDE, then you can create a lib directory and tell the compiler that all required jars are in there, at the time of compilation/execution. You can find HOW, in the former link given above.
Since you are using Maven, you just need to put the JDBC driver as a dependency in your pom.xml file. Maven will add it to the classpath whenever it compiles/runs your application.
What you do when deploying your application is dependent on the technologies in use.
If it's a command line application create a %CLASSPATH% variable or add the path to the jdbc.jar file using the java -cp {path\to\jdbc.jar} option.
If it's a web application, you'll need to package the driver jar in your .war/.ear/.sar (the maven assembly plugin can do this) or include it in the ./lib folder of the application container and declare it as scope=provided in maven.
Steps to setup JDBC for Eclipse projects
Download JDBC zip archive from
https://dev.mysql.com/downloads/connector/j/5.0.html
Extract the file and copy the executable jar file to program files->Java->jdk->bin
Right click on the project and select Buildpath->Add external archives->(Jar file)
Compile the program
you can directly connect database by following steps:
1) download mysql-connector-java 5.0.8 and extract the files.
2) then place the folder in program files.
3) then simply add this library on your project by right clicking on it.
4) and here you go. Run your app with db connectivity.

Downloaded Selenium Webdriver Java zip, but it is missing the selenium JARs

I downloaded the latest Selenium Webdriver zip file for Java and after I extracted it, I get a bunch of JAR files but missing the needed selenium-java-x.xx.x.jar file.
Selenium Client & WebDriver Language Bindings
http://www.seleniumhq.org/download/
Am I not extracting it correctly? I tried on both Mac and windows machine and I get these bunch of JARs instead.
Why do I not get the selenium JAR?
As Florent B. has commented, the old selenium-java-x.xx.x.jar was renamed to client-combined-x.x.x-nodeps.jar. The new name of the JAR was not very obvious.
Simply add this new JAR in your build path Libraries.
Before changing or adding new JARs. Please check if Eclipse is taking the correct Java-SE version for execution. This can be verified while creating a new Java project. Select the latest Java-SE version installed on your machine from the drop-down list during project creation.
enter image description here

JFreeChart Java JAR not running on a different machine

I have created an application using the JFreeChart library for use on another machine.
Previously I have developed applications with JFreeChart (using the same libraries) which has worked fine on other machines. The only difference is this machine is running Vista.
Please see below for the run-time exception I am getting:
The class that cannot be found, however, is located in the highlighted jar in the below image showing my imported libraries for the JAR. I have also established that this JAR is included in the manifest for the application. See below image:
So I very much need this to work and have no idea where to look next - or what is causing this problem!
Development machine Java version:
1.7.0_45
Target machine Java version:
1.7.0_45
Thanks in advance.
Check the Class-Path attribute in your JAR's manifest, which should contain entries like this:
Class-Path: lib/jfreechart-1.0.17.jar lib/jcommon-1.0.21.jar …
Also, examine dist/README.TXT in your NetBeans project folder, which should say something like this regarding libraries required by your project:
To run the project from the command line, go to the dist folder and
type the following:
java -jar "CISOnlineMonitor.jar"
To distribute this project, zip up the dist folder (including the lib folder)
and distribute the ZIP file.
This has nothing to do with os i belive.You dont have all the necessery libs within your jar.Try to open a jar and see if you have them in.Fact that you are able to run it on your maschine only proves that.Make executable jar with eclipse or whathever you use.And when it ask you for libs check -Extract required libraries into generated Jar.
if you dont know how to get to that point
File>Export>Java>Runnable Jar File> Runnable JAR File Specification.
Also right click on your project and check Your build path.
RightClick project>Properties>Java Build Path>Libraries
Make sure you have everything correct
EDIT-
As i see you use NetBeans im not sure exactly how to find all this there.Bud it will be very similiar.

How to make Java executable Jar file of WebDriver project

I am new to Java and Webdriver (Web QA automation framework). I have wrote a webdriver script which opens firefox browser. Open google.com. Make some searches and finish. N
I have created this script in Eclipse. Using Webdriver (Java), Junit, JDK6, Firefox any version on windows platform. It works fine when I run it in eclipse.
what I want to do is make a run able (executable-jar) file which has all the required classes libraries compiled into it. so that If I want to share this script with any one they don't need to install eclipse or download libraries. I expect them to have Windows, Firefox, JDK or JRE and the file I send them. and that should be all. They should be able to execute my script by double clicking my sent file (or in 1 0r 2 simple steps)
For last one week I have been trying to do this without any success. I select project, go to file, export > java > runnable jar file>
here it asks me for "Launch configuration" by a drop down menu
I do not see any launch configuration related to my project listed here
I searched for how to create launch configuration and found that they are automatically made when we run our projects. Apparently that seems not true for Junit (webdriver) java projects.
I am sharing project files and libraries links.
Dropbox link for Project files
https://www.dropbox.com/s/ipz95vkfh1m95wj/MakeWebdriverJar.zip
Selenium Webdriver Java Libraries (used in my project) can be downloaded here
http://selenium.googlecode.com/files/selenium-java-2.33.0.zip
This is my first posts # sack over flow. Any help would be really appreciate and make me move forward in my learning. Thank you.
PS: I have read there are ways to do it via terminal but since I am not good at that I want to find a way doing it via eclipse.
A very convenient tool to create a fully runnable jar, that I use for my projects is the FatJAR plugin for eclipse.
It can collect all the required classes into a single jar so you can deploy only one file. Of course you don't have to do it this way, you can choose what it should include and then it compiles the JAR from your selected libraries.
just simple, call the all required classes in "Main method" and right click on the Src folder in the eclipse then, click on export the main method in which you would call the required classes.
check this http://university.utest.com/selenium-basics-part-4-create-java-project-add-recorded-test-case-run-project/
then add in your class
public static void main(String[] args) throws Exception {
JUnitCore.main(
"qa.vozovoz.ru.TERMTERMSMScode");
}
then make a jar file
and then start it in cmd

How to integrate Selenium 2.21.0(previously Selenium RC) libraries with Eclipse?

I want to add Selenum 2.21 libraries to Eclipse java project. I tried two methods.
One through Command line:
I have downloaded the Selenium 2.2(previously selenium RC) from their website for Java and unzipped them. When I write, java -jar (selenium-filename).jar, I am getting 'No main manifest attribute' error.
I know, the line mainclass has to be added in manifest file. There is no folder for the manifest in v2.21.
I also had Seleniumv1.03, which had the Manifest option. I added the line and a new line character, as mentioned in another post in someplace, but still I faced the issue.
two through copy/paste of jar files under JRE system library of the project:
This action is also not allowed. Cannot paste under JRE system library corresponding to the project.
Can you please tell a step by step procedure, other than refering somewhere in Sun tutorial, where they have given about java cfe (jar name) (class name) (class name.class), for defining the entry point... I had tried that too, at present...
For other reference, Java6 Update 32, I have downloaded for SDK and JRE. Firefox 12 and ie9, I am using. Eclipse Indigo IDE for Java Developers is been used.
what you have to do it download selinium jar file and save it in your project folder(Prefer if you have a lib floder)
Then right click on project in project explorer. You can find build path option. Then click on it and it will show you configure build path option. Then you can add your library in to the project. Just show the path for selinium jar file.

Categories