How can we find the value of different attributes like name, class, value of an element?



How can we find the value of different attributes like name, class, value of an element?..

Answer / Sajjan Singh

In Selenium, you can find the value of different attributes like name, class, value by using WebElement methods such as `getAttribute(attributeName)`. For example, to get the value of the 'name' attribute, use `element.getAttribute('name')`, and for the 'class' attribute, use `element.getAttribute('class')`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

What is the use of logging in automation?

1 Answers  


How to create batch(.bat) file after creating suite from TestNG?Can anyone explain entire process?

2 Answers   Cube Digi,


What are the advantages of page object model framework?

1 Answers  


How you can find broken images in a page using selenium web driver?

1 Answers  


What is parameterized testing in testng?

1 Answers  


What is an explicit wait in selenium?

1 Answers  


Difference between @findByMethod and @findelement?

3 Answers   HCL,


Which are the languages supported by selenium rc?

1 Answers  


Why to choose python over java in selenium?

1 Answers  


Can we move back and forward in browser using selenium?

1 Answers  


How to select value in a dropdown?

1 Answers  


How is selenium different from qtp?

1 Answers  


Categories