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

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

Related

Journey browser Java Chromium Embedded framework throwing error?

I am trying to use a library called Journey browser which uses the Java Chromium Embedded Framework. I first created a Java Maven Project with Netbeans and I edited the pom.xml to match the values on the library's guide, which is here: https://github.com/CodeBrig/Journey, to add the maven dependencies. (No errors detected by Netbeans) I then built the project to download the maven dependency and put their default code (modified slightly) in the main class. Netbeans found no errors in the code. However, when I run the project I get a "no chrome_elf in java.library.path". I think this has something to do with embedding JCEF, but I am not sure how to add this to the "java.library.path" in Netbeans.
How do I fix this "chrome_elf" problem?
Also, if I am able to fix this will it be an error for production if someone doesn't have "chrome_elf" installed?
For Windows
This happens because the chrome_elf.dll (on Windows) file cannot be found.
Java is looking for this file on java.library.path - which (on my machine, anyway) refers to all the locations referenced by the Windows %path% environment variable.
One way to fix this is to download one of the pre-built distributions from that GitHub page (for example the Windows one, referred to here):
https://github.com/CodeBrig/Journey/releases/download/0.4.0-78-assets/jcef-distrib-windows64.zip
Then unzip the resulting jcef-distrib-windows64.zip. In the win64\bin\lib\win64 directory under that main directory you will find the chrome_elf.dll you need - and other binaries which are also needed.
Add this directory to your path - either by adding it to the Windows environment variable or via java -Djava.library.path=....
For example, the path may be similar to this:
C:\your\path\to\jcef-distrib-windows64\win64\bin\lib\win64
This should allow you to run the demo code provided in the JourneyBrowser class. A browser window should open as a result.
Here is the browser:
The above steps worked for me - and the only files I needed to keep from the (large) distribution download were those in the jcef-distrib-windows64\win64\bin\lib\win64 directory. It's possible that I already have some other dependencies which may be needed - so I cannot guarantee this process will also work for you.
For Linux (and MacOS)
I have not tried this on a Linux machine. But in that case, I believe you will need to download and unzip the jcef-distrib-linux64 release - and then point to the jcef-distrib-linux64\linux64\bin\lib\linux64 directory, containing libcef.so and other libraries.
Similarly for MacOS, there is a distribution which can be downloaded and unzipped.
Alternative
An alternative is to simply use the pre-built distributions provided on GitHub, using the commands provided. Obviously, in this case, you will not be creating your own customized implementation (so, no JourneyBrowser class).
copy scr/native/Release to jcef_build/native/Release from the default output directory of VS.check whether the Release exists in java.lib.path

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.

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.

installing selenium-java-2.5.0 in eclipse

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...)

Categories