Selenium WebDriver Start-Kit

Content overview- check out my youtube video for step by step guidance: https://www.youtube.com/watch?v=x1JA5-IfMlY&t=1s

  1. Downloads
  2. Maven POM script example
  3. Open browser script examples in Chrome and Firefox

Downloads:

IDE: https://www.jetbrains.com/idea/?fromMenu

JAVA SDK: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Testing framework: http://testng.org/doc/maven.html

Maven: https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api/3.3.9

Browser Drivers

ChromeDriver

http://chromedriver.storage.googleapis.com/index.html?path=2.27/

Firefox Driver

https://github.com/mozilla/geckodriver/releases

Internet Explorer

http://www.seleniumhq.org/download/

Integrated development environment

https://www.jetbrains.com/idea/

___________________________

Feb 25, 2017

Working list of configuration:

POM

__________________________

<dependencies>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.53.0</version>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.3.9</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
</dependency>

_______________________________________________________________________________

Test case

 package Logintest;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.MarionetteDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;

/**
* Created by charliyntran on 2/18/17.
*/
public class TestA_installationTest {

@Test
public void WebDriver() {

//FF browser
//   System.setProperty(“webdriver.gecko.driver”,”geckodriver”);
//   DesiredCapabilities capabilities= DesiredCapabilities.firefox();
//   capabilities.setCapability(“Marionette”, true);
//   WebDriver driver = new MarionetteDriver(capabilities);
//   driver.navigate().to(“https://www.google.com&#8221;);
//   driver.quit();

//Chrome browser

System.setProperty(“webdriver.chrome.driver”, “chromedriver”);
ChromeDriver driver;
driver = new ChromeDriver();
driver.navigate().to(https://www.google.com&#8221;);
//driver.quit();
driver.close();

//   //Internet broswer
//   InternetExplorerDriver driver;
//   System.setProperty(“webdriver.IE.driver”, “IEDriverServer.exe”);
//   driver = new InternetExplorerDriver();
//   driver.navigate().to(“https://www.google.com&#8221;);
//   driver.quit();

}

}

___________________________________________________________

   public class openFF {

@Test
public void WebDriver(){
System.setProperty(“webdriver.gecko.driver”,“geckodriver”);
DesiredCapabilities capabilities= DesiredCapabilities.firefox();
capabilities.setCapability(“Marionette”, true);
WebDriver driver = new MarionetteDriver(capabilities);
driver.navigate().to(https://www.google.com&#8221;);
driver.quit();

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s