事情就这样了:假设您的myElements将如下所示:
List<WebElement> myElements =driver.findElements(By.cssSelector("li[class*='rlbItem']")); for(WebElement li : myElements) { System.out.println(li.getText()); System.out.println(); for (int i=0; i<Name.length(); i++) { if(li.getText().equalsIgnoreCase(Name[i])) { //Clicks on the matched webelement li.click(); } } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)