-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTestExpectedConditions.java
More file actions
56 lines (46 loc) · 1.6 KB
/
Copy pathTestExpectedConditions.java
File metadata and controls
56 lines (46 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package testcase;
import java.util.concurrent.TimeUnit;
import helper.AlertHelper;
import helper.ButtonHelper;
import helper.LinkHelper;
import helper.StartWebDriver;
import helper.WindowHelper;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;
/**
* @author - rahul.rathore
* @date - 16-Nov-2014
* @project - Webdriver
* @package - testcase
* @file name - TestExpectedConditions.java
*/
public class TestExpectedConditions extends StartWebDriver {
@Test
public void testConditions() {
/*WindowHelper.navigateToPage("http://www.w3schools.com/js/tryit.asp?filename=tryjs_timing1");
driver.switchTo().frame(driver.findElement(By.id("iframeResult")));
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.pollingEvery(1, TimeUnit.SECONDS);
ButtonHelper.clickButton("//button[text()='Try it']");
wait.until(ExpectedConditions.alertIsPresent());
System.err.println("Text : " + AlertHelper.getText());
AlertHelper.clickOk();
*/
WindowHelper.navigateToPage(file.getUrl());
LinkHelper.clickLink("File a Bug");
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.pollingEvery(1, TimeUnit.SECONDS);
wait.until(new ExpectedCondition<WebElement>() {
@Override
public WebElement apply(WebDriver arg0) {
return driver.findElement(By.id("Bugzilla_password"));
}
});
System.out.println("Login Page Displayed");
}
}