0
What is the difference between Name and Class locators in selenium?
Difference between driver.findElement(By.class) and driver.findElement(By.Name)?
1 Answer
+ 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 đđŸ