david
david

Reputation: 6805

How do I click this button using Selenium Webdriver?

<input class="ch4_btn ch4_btnOrange ch4_btnDropShadow ch4_btnPlaceOrder" value="PLACE ORDER" type="button">

How do I "click" this button using selenium webdriver (in Python).

I tried:

driver.find_element_by_id("ch4_reviewBtnTopRt").click()

and

driver.find_element_by_css_selector("ch4_reviewBtnTopRt").click()

and got the error:

NoSuchElementException: Message: Unable to locate element:

Upvotes: 0

Views: 87

Answers (2)

murali selenium
murali selenium

Reputation: 3927

Use below css selector

 input.ch4_btn.ch4_btnOrange.ch4_btnDropShadow.ch4_btnPlaceOrder

you can also try below xpath

 //input[@value='PLACE ORDER']

Upvotes: 0

Ranjith&#39;s
Ranjith&#39;s

Reputation: 4740

try this:

driver.find_element_by_css_selector("input.ch4_btnOrange").click()

Upvotes: 4

Related Questions