How to select element by class in Selenium?
I want to select a div element having class= 'product-pageproduct-price', but its not working properly.
Below is the code snippet which I have written to select element by class, but it is not working, I dont understand where I am doing wrong.
I tried using xpath instead of class also, it was not working. WebElement element = Driver.FindElement(By.
You need to use @FindElements instead of @FindElement. FindElements returns a List of elements while FindElement returns a WebElement. So change your code to :
WebElement element = Driver.FindElements(By.
Related Answers
How can we use the Selenium tool with HeadSpin?
Selenium is a tool that is used to automate functional testing. There are two types...
What are 5 Uses of Selenium?
Selenium is a web-automation tool that helps you to test web applications....
How can we use the Selenium tool with HeadSpin?
Selenium is a cross-browser testing automation framework w...