How do I select a div using both it's id and class in Selenium firefox addon?
EDIT: I managed to solve it, I used an xpath expression with both the attributes @id= and @class =
How do I select a div using both it's id and class in Selenium firefox addon?
EDIT: I managed to solve it, I used an xpath expression with both the attributes @id= and @class =
I stumbled upon this question and thought I would leave an example of the answer that the OP didn't leave (as requested by vincebowdren above):
//*/fieldset[@class="openable"][@id="activityFieldset"]
This would select a fieldset element with the openeable class and activityFieldset id.
I would like to post another correct answer for future reference.
First of all there have been other correct answers here: https://stackoverflow.com/a/42996525/6569715
A valid example would be to define a locator by multiple attributes:
HEADER_1_TEXT = (
By.XPATH,
"//h2[@class='text-primary' and @id='my-id' and text() ='Get started with Us']")
I managed to solve it, I used an xpath expression with both the attributes @id= and @class =