Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use multiple parameters for the function findElements in selenium WebDriver

Can I use findElements() in selenium WebDriver, with multiple Bys.

That is can I use findElements(By.tagName() & By.className()) in Selenium?

like image 463
rockyfy Avatar asked Oct 27 '25 12:10

rockyfy


1 Answers

You can use the following syntax:

driver.findElement(new ByChained(By.id("foo"),By.xpath("//*[.=’ABCD’]")));

You can see this thread for more details:

like image 197
DRK Avatar answered Oct 30 '25 13:10

DRK