0
What is the difference between Name and Class locators in selenium?
Difference between driver.findElement(By.class) and driver.findElement(By.Name)?
1 Resposta
+ 3
Name and Class are different attributes of an element.
Say I have an element
<button name=“myButton” class=“test myClass” ... />
I can then use By.className(“test”) or By.Name(“myButton”) in the findElement() method to find this button
Have a look at the html at work you’re writing your selenium classes for and see what attributes you can find elements by 👍🏾