Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04b "Jack Jackrum". upgrade now! [54.2] (what's this?)
Hotfix release available: 2023-04-04a "Jack Jackrum". upgrade now! [54.1] (what's this?)
New release available: 2023-04-04 "Jack Jackrum". upgrade now! [54] (what's this?)
Hotfix release available: 2022-07-31b "Igor". upgrade now! [53.1] (what's this?)
Hotfix release available: 2022-07-31a "Igor". upgrade now! [53] (what's this?)
New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
New release candidate 2 available: rc2022-06-26 "Igor". upgrade now! [52.1] (what's this?)
New release candidate available: 2022-06-26 "Igor". upgrade now! [52] (what's this?)
Hotfix release available: 2020-07-29a "Hogfather". upgrade now! [51.4] (what's this?)
New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
Hotfix release available: 2018-04-22b "Greebo". upgrade now! [50.2] (what's this?)
selenium_automation_setup_for_java

Selenium Automation SetUp File

Steps to install Selenium web driver in Eclipse:

Step 1: Install Java on your computer:

Download and install the Java Software Development Kit (JDK).

For Ubuntu:

1. Open Applicaction → Accessories → Terminal 2. Type commandline as below sudo apt-get install openjdk-8-jdk 3. Type commandline as below apt-cache search jdk (Note: openjdk-8-jdk is symbolically used here. You can choose the JDK version as per your requirement.) 4. For “JAVA_HOME” (Environment Variable) type command as shown below, in “Terminal” using your installation path… export JAVA_HOME=/usr/lib/jvm/java-8-openjdk (Note: “/usr/lib/jvm/java-8-openjdk” is symbolically used here just for demostration. You should use your path as per your installation.) 5. For “PATH” (Environment Variable) type command as shown below, in “Terminal” using your installation path… export PATH=$PATH:/usr/lib/jvm/java-8-openjdk/bin (Note: “/usr/lib/jvm/java-8-openjdk” is symbolically used here just for demostration. You should use your path as per your installation.) 6. Check for “open jdk” installation, just type command in “Terminal” as shown below javac -version

For Windows:

You download the JDK file from this location: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Note: This JDK version comes bundled with Java Runtime Environment (i.e. JRE) so we don't need to install the JRE separately.

Step 2: Install Eclipses IDE For Windows and Ubuntu: Now download “Eclipse IDE for Java Developers”. You can download eclipses from this location: http://www.eclipse.org/downloads/

Make sure to choose correct link for downloading eclipses which corresponds to your OS i.e. for Linux 32 Bit and 64 Bit versions.

You should be able to download a ZIP file named “eclipse-inst-linux64.tar.gz”.

Inside the ZIP file, there is an “eclipse” folder which contains all the application files. So we can extract the “eclipse” folder anywhere in your PC. Let say we want to extract it to C drive.

Step 3 – Download the Selenium Java Client Driver

You can download the Selenium Java Client Driver from this location: http://docs.seleniumhq.org/download/

Click on Download link which is associated with java release. Download the jar files. You will find client drivers for other languages there, but only choose the one for Java as shown above in the screenshot.

After downloading you will get a folder which should contain two jar files related to selenium, a lib folder which also contains jar files inside it. Beside this, there is a change log file as well. 

Refer to the screenshot below.

Create a new folder with name say 'Selenium' in C drive and extract the jar files to 'Selenium' folder.

Step 4: Create a New project in Eclipse:

Navigate to C drive and open eclipse folder where we have extacted all the application files related to eclipse. In Eclipse folder you would find a 'eclipse.exe' file. Now click on the .exe file
This would ask you to select a workspace, you may accept the default location or simply create a new workspace inside C drive and confirm OK.
Click on  Help > Eclipse Marketplace , type TestNG and click Install. This pack will dowload with Maven. 
Enter text as 'TestNG' and click on GO to search. You will now see TestNG with install option (If TestNG is already installed, you will have 'Update' and 'Uninstall'. as in the below screen shot)

After successful installation: Go to Window → Preferences. TestNG is enlisted at the left panel in pop-up. Now in Eclipse create a new project and iting click on File menu –> New –> Java Project → Name the project as “testproject” and click finish - Create a new Java class, for doing this again click on File menu –> New → Class then name it as “testclass” and select the checkbox for 'public static void main (String[] args) and click finish. - Create a new Java class, for doing this again click on File menu –> New → Class then name it as “testclass” and select the checkbox for 'public static void main (String[] args) and click finish.

On clicking 'Finish' in 'Java Class' wizard, your Eclipse IDE should look like the image below.

- Now Right-click on testproject and select Properties. - On the Properties window, click on “Java Build Path”. - Click on the Libraries tab, and then click “Add External JARs..” - Navigate to C:\selenium-3.3.1\ (or any other location where you saved the extracted contents of “selenium-3.3.1.zip” in step 3). - Add all the JAR files inside and outside the “libs” folder. Your Properties window after adding all the jar file should now look similar to the image below.

Add Selenium Java jar, you may add the source file too.

And also add all the jars from the libs folder as well.

 

- Finally, click OK and we have completed importing Selenium libraries into our project. Downloads Drivers: Install ChromeDriver for Ubuntu: sudo apt-get install unzip

wget -N http://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip unzip chromedriver_linux64.zip chmod +x chromedriver

sudo mv -f chromedriver /usr/local/share/chromedriver sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver For Windows: https://chromedriver.storage.googleapis.com/index.html?path=2.28/ The chrome driver can be dowloaded from the above URL and place it in the following path: /home/user/chromedriver

Chronium driver for Ubuntu and window users The chronium driver can be dowloaded from the clicking on the link https://www.nuget.org/packages/Chromium.ChromeDriver/ and place it the following path: /usr/lib/chromium-browser/chromedriver

selenium_automation_setup_for_java.txt · Last modified: 2018/08/31 16:16 (external edit)