Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import junit.framework.TestCase;
  2. import org.openqa.selenium.*;
  3. import org.openqa.selenium.remote.*;
  4. import java.net.URL;
  5. import java.util.concurrent.TimeUnit;
  6.  
  7. public class SimpleTest extends TestCase {
  8.     private WebDriver driver;
  9.  
  10.     private WebElement searchTextField(string fieldId) {
  11.         return this.driver.findElement(By.id(fieldId));
  12.     }
  13.  
  14.     @Before
  15.     public void setUp() throws Exception {
  16.         this.driver = new RemoteWebDriver(new URL("http://key:secret@hub.testingbot.com/wd/hub"));
  17.         driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  18.     }
  19.  
  20.     @Test
  21.     public void testSimple() throws Exception {
  22.         this.driver.get("http://www.google.com");
  23.         assertEquals("Google", this.driver.getTitle());
  24.     }
  25.  
  26.     @After
  27.     public void tearDown() throws Exception {
  28.         this.driver.quit();
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement