1
有一個下拉列表,我需要比較新的值與舊的月份字符串= 2015年9月(非常規井)。那麼如果不是等於那麼這是一個新的月份,它應該被下載,否則出來的循環。我可以把列表放入ArrayList並比較字符串嗎?如何使用selenium web driver/java將列表<webelement>添加到ArrayList中?
請幫助下
WebDriver driver=new FirefoxDriver();
//opening the PA page
driver.get("http://www.depreportingservices.state.pa.us/ReportServer/Pages/ReportViewer.aspx?%2fOil_Gas%2fOil_Gas_Well_Historical_Production_Report");
//maximizing the window
driver.manage().window().maximize();
WebElement select = driver.findElement(By.xpath(".//*[@id='ReportViewerControl_ctl04_ctl03_ddValue']"));
//List<WebElement> options = select.findElements(By.tagName("option"));
String str="Sep 2015 (Unconventional wells)";
你可能會笑現在。這是用java寫的嗎?請幫我用java代碼 – user2762008
,我只需要在webdriver :( – user2762008
我們可以在webdriver中試試這個嗎?你有很大的幫助 – user2762008