Create a gist now

Instantly share code, notes, and snippets.

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