Getting Selenium working on Mac
1. Download Java - jdk from:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Fllow the instructions to install jdk.
Add jdk installed path to your environment.
On Mac -
Go to the terminal and type
Select your Control key and o on your keyborad to write out.
Press Enter to accept the changes.
Then, Control and x to come off.
Check that jdk is installed.
Go to another terminal, type -
Something like the following should return-
2. Download Eclipse IDE for jee users-
https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplersr2
Follow the instructions to installed your system type installation.
3. Download Chrome webDriver jar -
https://sites.google.com/a/chromium.org/chromedriver/downloads
4. Download the safariDriver from -
http://www.seleniumhq.org/download/
Double click on it and click trust when safari prompt.
5. Go to your eclipse IDE
Create a java project
And
Add the following with imports
1. Download Java - jdk from:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Fllow the instructions to install jdk.
Add jdk installed path to your environment.
On Mac -
Go to the terminal and type
nano .profile
Type the folowing into your profile:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Homeexport JAVA_HOME
Select your Control key and o on your keyborad to write out.
Press Enter to accept the changes.
Then, Control and x to come off.
Check that jdk is installed.
Go to another terminal, type -
java -version
Something like the following should return-
java version "1.8.0_151"Java(TM) SE Runtime Environment (build 1.8.0_151-b12)Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
2. Download Eclipse IDE for jee users-
https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/keplersr2
Follow the instructions to installed your system type installation.
3. Download Chrome webDriver jar -
https://sites.google.com/a/chromium.org/chromedriver/downloads
4. Download the safariDriver from -
http://www.seleniumhq.org/download/
Double click on it and click trust when safari prompt.
5. Go to your eclipse IDE
Create a java project
And
Add the following with imports
//import org.openqa.selenium.firefox.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.safari.SafariDriver;
public class Testing {
public static void main(String[] args) {
//FirefoxDriver fDriver = new FirefoxDriver();
//ChromeDriver cDriver = new ChromeDriver();
WebDriver driver = new SafariDriver();
}
}
comment out '//' and test one after the other.
There's another way to add Selenium jars to our project. This is through the use of maven.
Comments
Post a Comment