Created
March 13, 2015 02:30
-
-
Save safrrhmn/b614f6eb7ab92b1b282f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.testng.annotations.*; | |
/** | |
* Created by Saifur on 2/14/2015. | |
*/ | |
public class HelloSelenium { | |
WebDriver driver; | |
String url = "https://github.com/"; | |
@BeforeClass | |
public void SertUpTest(){ | |
System.setProperty("webdriver.chrome.driver", "\\working\\Seleniumjava\\drivers\\chromedriver.exe"); | |
//System.setProperty("webdriver.ie.driver", "\\working\\Seleniumjava\\drivers\\IEDriverServer.exe"); | |
driver = new ChromeDriver(); | |
//driver = new FirefoxDriver(); | |
//driver = new InternetExplorerDriver(); | |
driver.navigate().to(url); | |
driver.manage().window().maximize(); | |
} | |
@AfterClass | |
public void CleaUpDriver(){ | |
driver.quit(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.By; | |
import org.testng.Assert; | |
import org.testng.annotations.Test; | |
/** | |
* Created by Saifur on 3/12/2015. | |
*/ | |
public class TestClass1 extends HelloSelenium { | |
@Test | |
public void DemoTest() throws InterruptedException { | |
driver.findElement(By.cssSelector(".js-site-search-form>input")).sendKeys("TestClass1"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.By; | |
import org.testng.annotations.Test; | |
/** | |
* Created by Saifur on 3/12/2015. | |
*/ | |
public class TestClass2 extends HelloSelenium { | |
@Test | |
public void DemoTest() throws InterruptedException { | |
driver.findElement(By.cssSelector(".js-site-search-form>input")).sendKeys("TestClass2"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment