Last active
April 4, 2017 18:48
-
-
Save miketoth/cc66e545ddbc322f863ba6669aaebbfa to your computer and use it in GitHub Desktop.
Selenium Test Java
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
package com.way2b1.examples; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.openqa.selenium.support.ui.ExpectedCondition; | |
import org.openqa.selenium.support.ui.Wait; | |
import org.openqa.selenium.support.ui.WebDriverWait; | |
public class GoogleSearch { | |
static WebDriver driver; | |
static Wait<WebDriver> wait; | |
public static void main(String[] args) { | |
driver = new FirefoxDriver(); | |
wait = new WebDriverWait(driver, 30); | |
driver.get("http://www.google.com/"); | |
boolean result; | |
try { | |
result = firstPageContainsWay2b1(); | |
} catch(Exception e) { | |
e.printStackTrace(); | |
result = false; | |
} finally { | |
driver.close(); | |
} | |
System.out.println("Test " + (result? "passed." : "failed.")); | |
if (!result) { | |
System.exit(1); | |
} | |
} | |
private static boolean firstPageContainsWay2b1() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment