私はここで問題があります。私は同じ "id"のドロップダウンボックスを自動化しようとしています。 3つのドロップダウンボックスがあります。それぞれの下で1つのオプションを選択する必要があります。助けて ? ウェブサイト:http://bookboon.com/en/basics-of-accounting-information-processing-ebook#download同じ "id"のドロップダウンボックスの妥当性確認
package flow;
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;
public class bookboon {
static WebDriver d ;
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\User_2\\Downloads\\chromedriver_win32\\chromedriver.exe");
d = new ChromeDriver();
d.get("http://bookboon.com/en/accounting-ebooks");
List<WebElement> downlinks = d.findElements(By.className("pdf"));
for(int i=1;i<=downlinks.size();i++) {
downlinks.get(i).click();
d.findElement(By.id("email")).sendKeys("[email protected]");
d.findElement(By.id("undefined_flexselect")).sendKeys("Studying");
d.findElement(By.id("undefined_flexselect")).sendKeys("Engineer/Science MSc");
d.findElement(By.id("undefined_flexselect")).sendKeys("All India Institute of Medical Sciences (AIIMS), Delhi");
//d.navigate().back();
//downlinks = d.findElements(By.className("pdf"));
}
}
}
私はまたのXpathでみました。それを完了できませんでした。助けてください !
ありがとう、働くクール – SarathChandar
それは完璧に動作していますなぜ人々は私の答えをdownvoted私は知らない –