hinzufügen Ich brauche, um Links auf meiner Website zu automatisieren. Ich möchte Xpath-Werte einmal in jeder Iteration der Schleife übergeben. Damit ich meine Codierung
public class Popup {Wie Looping-Bedingung für Selen-Java-Code
private WebDriver driver;
private String baseUrl;
//private boolean acceptNextAlert = true;
private StringBuffer verificationErrors = new StringBuffer();
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
baseUrl = "http://www.example.com/info.php";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testPopup() throws Exception {
driver.findElement(By.xpath("//div[@id='info-list']/div[2]/div/div/div/div/a[2]/i")).click();
driver.findElement(By.xpath("//div[@id='info-list']/div[2]/div/div/div/div/a[3]/i")).click();
driver.findElement(By.xpath("//div[@id='info-list']/div[2]/div/div/div/div/a[4]/i")).click();
driver.findElement(By.xpath("//div[@id='info-list']/div[2]/div/div/div/div/a[5]/i")).click();