简体   繁体   中英

Finiding multiple objects at a time by using Selenium Webdriver

如何使用Java中的Selenium Web驱动程序一次查找两个对象。

ID's and xpath's are unique for each element in HTML. You can choose other options like
1) cssSelector
2) CLASS
3) TAGNAME
4) Link

You can to create a data structure like link to store all the elements.
Example:

WebDriver driver = new FireFoxDriver();
List options= driver.findElements(By.tagName("p"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM