Selenium Installation (JAVA)
OS : Windows and MAC
1 INSTALL JAVA ON YOUR COMPUTER
Download and install the Java Software Development Kit (JDK).
http://www.oracle.com/technetwork/java/javase/downloads/index.html
This JDK version comes bundled with Java Runtime Environment (JRE) so you do not need to download and install the JRE separately.
1.1 JDK INSTALLATION FOR MAC OS
Note that installing the JDK on a Mac is performed on a system wide basis, for all users, and administrator privileges are required. You cannot install Java for a single user.
Installing the JDK also installs the JRE. The one exception is that the system will not replace the current JRE with a lower version. To install a lower version of the JRE, first uninstall the current version.
When you download the Java Development Kit (JDK), the associated Java Runtime Environment (JRE) is installed at the same time. The JavaFX SDK and Runtime are also installed and integrated into the standard JDK directory structure.
Depending on your processor, the downloaded file has one of the following names:
• jdk-7u<version>-macosx-amd64.dmg
• jdk-7u<version>-macosx-x64.dmg
Where <version> is 6 or later.
1. Download the file. Before the file can be downloaded, you must accept the license agreement.
2. From either the Downloads window of the browser, or from the file browser, double click the .dmg file to launch it.
3. A Finder window appears containing an icon of an open box and the name of the .pkg file Double click the package icon to launch the Install app.
4. The Install app displays the Introduction window. Click Continue.
4a. Note that, in some cases, a Destination Select window appears. This is a bug, as there is only one option available. If you see this window, select Install for all users of this computer to enable the continue button. Click Continue.
5. The Installation Type window appears. Click Install.
6. A window appears which says "Installer is trying to install new software. Type your password to allow this." Enter the Administrator login and password and click Install Software.
7. The software is installed and a confirmation window appears
After the software is installed, delete the dmg file if you want to save disk space.
1.2 UNINSTALL THE JDK (MAC OS)
To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.
Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format:*
/Library/Java/JavaVirtualMachines/jdk<major>.<minor>.<macro[_update]>.jdk
For example, to uninstall 7u6:
% rm -rf jdk1.7.0_06.jdk
Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.
*The 7u4 and 7u5 releases were installed into a directory that does not follow this format. To uninstall 7u4 or 7u5, remove the 1.7.0.jdk directory from the same location.
2 INSTALL ECLIPSE IDE
Download "Eclipse IDE for Java Developers".
http://www.eclipse.org/downloads/
Be sure to choose correctly between Windows 32 Bit and 64 Bit versions.
You should be able to download a ZIP file named "eclipse-java-juno-SR1-win32-x86_64.zip" (the version number "SR1" may change over time).
Inside that ZIP file, there is an "eclipse" folder which contains all the application files. You can extract the "eclipse" folder anywhere you want in your PC; but for this tutorial, extract it to your C drive.
Unlike other popular software, no installation is required to use eclipse.
For MAC OS:
3 DOWNLOAD THE SELENIUM JAVA CLIENT DRIVER
You can download the Selenium Java Client Driver from
http://docs.seleniumhq.org/download/
You will find client drivers for other languages there, but only choose the one for Java.
This download comes as a ZIP file named "selenium-2.25.0.zip". For simplicity, extract the contents of this ZIP file on your C drive so that you would have the directory "C:\selenium-2.25.0\". This directory contains all the JAR files that we would later import on Eclipse.
4 CONFIGURE ECLIPSE IDE WITH WEB DRIVER
1. Launch the "eclipse.exe" file inside the "eclipse" folder that we extracted in step 2. If you followed step 2 correctly, the executable should be located on C:\eclipse\eclipse.exe.
2. When asked to select for a workspace, just accept the default location.
3. Create a new project through File > New > Java Project. Name the project as "myproject".
4. Right-click on the newly created project and select New > Package, and name that package as "mypackage".
5. Create a new Java class under mypackage by right-clicking on it and then selecting New > Class, and then name it as "myclass". Your Eclipse IDE should look like the image below.
6. Right-click on myproject and select Properties.
7. On the Properties dialog, click on "Java Build Path".
8. Click on the Libraries tab, and then click "Add External JARs.."
9. Navigate to C:\selenium-2.25.0\ (or any other location where you saved the extracted contents of "selenium-2.25.0.zip" in step 3).
10. Add all the JAR files inside and outside the "libs" folder. Your Properties dialog should now look similar to the image below.
11. Finally, click OK and we are done importing Selenium libraries into our project.
OS : Windows and MAC
1 INSTALL JAVA ON YOUR COMPUTER
Download and install the Java Software Development Kit (JDK).
http://www.oracle.com/technetwork/java/javase/downloads/index.html
This JDK version comes bundled with Java Runtime Environment (JRE) so you do not need to download and install the JRE separately.
1.1 JDK INSTALLATION FOR MAC OS
Note that installing the JDK on a Mac is performed on a system wide basis, for all users, and administrator privileges are required. You cannot install Java for a single user.
Installing the JDK also installs the JRE. The one exception is that the system will not replace the current JRE with a lower version. To install a lower version of the JRE, first uninstall the current version.
When you download the Java Development Kit (JDK), the associated Java Runtime Environment (JRE) is installed at the same time. The JavaFX SDK and Runtime are also installed and integrated into the standard JDK directory structure.
Depending on your processor, the downloaded file has one of the following names:
• jdk-7u<version>-macosx-amd64.dmg
• jdk-7u<version>-macosx-x64.dmg
Where <version> is 6 or later.
1. Download the file. Before the file can be downloaded, you must accept the license agreement.
2. From either the Downloads window of the browser, or from the file browser, double click the .dmg file to launch it.
3. A Finder window appears containing an icon of an open box and the name of the .pkg file Double click the package icon to launch the Install app.
4. The Install app displays the Introduction window. Click Continue.
4a. Note that, in some cases, a Destination Select window appears. This is a bug, as there is only one option available. If you see this window, select Install for all users of this computer to enable the continue button. Click Continue.
5. The Installation Type window appears. Click Install.
6. A window appears which says "Installer is trying to install new software. Type your password to allow this." Enter the Administrator login and password and click Install Software.
7. The software is installed and a confirmation window appears
After the software is installed, delete the dmg file if you want to save disk space.
1.2 UNINSTALL THE JDK (MAC OS)
To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.
Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format:*
/Library/Java/JavaVirtualMachines/jdk<major>.<minor>.<macro[_update]>.jdk
For example, to uninstall 7u6:
% rm -rf jdk1.7.0_06.jdk
Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.
*The 7u4 and 7u5 releases were installed into a directory that does not follow this format. To uninstall 7u4 or 7u5, remove the 1.7.0.jdk directory from the same location.
2 INSTALL ECLIPSE IDE
Download "Eclipse IDE for Java Developers".
http://www.eclipse.org/downloads/
Be sure to choose correctly between Windows 32 Bit and 64 Bit versions.
You should be able to download a ZIP file named "eclipse-java-juno-SR1-win32-x86_64.zip" (the version number "SR1" may change over time).
Inside that ZIP file, there is an "eclipse" folder which contains all the application files. You can extract the "eclipse" folder anywhere you want in your PC; but for this tutorial, extract it to your C drive.
Unlike other popular software, no installation is required to use eclipse.
For MAC OS:
3 DOWNLOAD THE SELENIUM JAVA CLIENT DRIVER
You can download the Selenium Java Client Driver from
http://docs.seleniumhq.org/download/
You will find client drivers for other languages there, but only choose the one for Java.
This download comes as a ZIP file named "selenium-2.25.0.zip". For simplicity, extract the contents of this ZIP file on your C drive so that you would have the directory "C:\selenium-2.25.0\". This directory contains all the JAR files that we would later import on Eclipse.
4 CONFIGURE ECLIPSE IDE WITH WEB DRIVER
1. Launch the "eclipse.exe" file inside the "eclipse" folder that we extracted in step 2. If you followed step 2 correctly, the executable should be located on C:\eclipse\eclipse.exe.
2. When asked to select for a workspace, just accept the default location.
3. Create a new project through File > New > Java Project. Name the project as "myproject".
4. Right-click on the newly created project and select New > Package, and name that package as "mypackage".
5. Create a new Java class under mypackage by right-clicking on it and then selecting New > Class, and then name it as "myclass". Your Eclipse IDE should look like the image below.
6. Right-click on myproject and select Properties.
7. On the Properties dialog, click on "Java Build Path".
8. Click on the Libraries tab, and then click "Add External JARs.."
9. Navigate to C:\selenium-2.25.0\ (or any other location where you saved the extracted contents of "selenium-2.25.0.zip" in step 3).
10. Add all the JAR files inside and outside the "libs" folder. Your Properties dialog should now look similar to the image below.
11. Finally, click OK and we are done importing Selenium libraries into our project.
No comments:
Post a Comment