Skip to content

Instantly share code, notes, and snippets.

@ShigeoTejima
Created June 9, 2016 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShigeoTejima/c2780150c1da3f25eaec33a7b13e7f58 to your computer and use it in GitHub Desktop.
Save ShigeoTejima/c2780150c1da3f25eaec33a7b13e7f58 to your computer and use it in GitHub Desktop.
Testcase for confrim the behavior by Selenide and IEDriver versions.
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");
}
}
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