-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathAccordianControl.java
More file actions
31 lines (24 loc) · 901 Bytes
/
Copy pathAccordianControl.java
File metadata and controls
31 lines (24 loc) · 901 Bytes
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
package allTests;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import resources.UITestPracticePage;
import utility.FrameworkConstants;
public class AccordianControl {
public static void main(String[] args) {
System.setProperty(FrameworkConstants.CHROME_DRIVER_KEY,FrameworkConstants.CHROME_DRIVER_PATH);
WebDriver driver = new ChromeDriver();
driver.get("http://uitestpractice.com/Students/");
System.out.println(driver.getCurrentUrl());
List<WebElement> accordionLinks = UITestPracticePage.using(driver).accordianLinks;
System.out.println(accordionLinks.size());
for(WebElement element:accordionLinks) {
if(element.getText().equals("Coded UI")){
element.findElement(By.tagName("span")).click();
}
}
// driver.quit();
}
}