Created
June 9, 2016 05:25
-
-
Save ShigeoTejima/c2780150c1da3f25eaec33a7b13e7f58 to your computer and use it in GitHub Desktop.
Testcase for confrim the behavior by Selenide and IEDriver versions.
This file contains hidden or 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
public class HelloTest { | |
@BeforeClass | |
public static void beforeClass() { | |
System.setProperty("webdriver.ie.driver", "change iedriver path"); | |
Configuration.browser = WebDriverRunner.INTERNET_EXPLORER; | |
} | |
@Test | |
public void google() { | |
open("http://google.co.jp"); | |
Selenide.$("[name=q]").val("Selenide"); | |
Screenshots.takeScreenShot("google"); | |
} | |
} |
This file contains hidden or 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
public class HelloTest { | |
private WebDriver driver; | |
@Before | |
public void before() { | |
System.setProperty("webdriver.ie.driver", " iedriver path"); | |
driver = new InternetExplorerDriver(); | |
} | |
@After | |
public void after() { | |
driver.quit(); | |
} | |
@Test | |
public void google() { | |
driver.get("http://google.co.jp"); | |
driver.findElement(By.name("q")).sendKeys("Selenium"); | |
File tempFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); | |
try { | |
FileUtils.moveFile(tempFile, new File("build/reports/tests/" + tempFile.getName())); | |
} catch (IOException ex) { | |
Logger.getLogger(HelloTest.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment