0

Page source code below:

<button class="ui-button-primary ui-button ui-widget ui-state-default 
ui-corner-all ui-button-text-only" type="submit" data-
qa="sidebar.find.submit.button" role="button" aria-disabled="false">
<span class="ui-button-text">Find</span></button>

How do I click this button with Selenium Webdriver and is it possible to click it using the qa=sidebar.find.submit.button

3 Answers 3

1

Sure, you can use a CSS selector:

driver.find_element_by_css_selector('button[data-qa="sidebar.find.submit.button"]')
Sign up to request clarification or add additional context in comments.

2 Comments

Is there another way to select this button? This way did not work for some reason. I got 'unable to locate element' error.
@david sorry, fixed the selector, check it out.
0

Here you Go

driver.findElement(By.xpath("//button[@data-qa='sidebar.find.submit.button']")).click();

Comments

0

And in python, this way :

driver.find_element_by_xpath("//button[@data-qa='sidebar.find.submit.button']")).click();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.