Selenium can't find button

0 votes

Here is the HTML:

<button id="getCoupon" class="getCoupon" onclick="IWant()" style="" data-i18n="view_prod_get_coupon">Get Your Coupon</button>

I have been trying these ways of finding the button:

1. driver.find_element_by_id('getCoupon').click()
2. driver.find_element_by_xpath('//*[@id="getCoupon"]').click()
3. driver.find_element_by_class_name('getCoupon').click()

None of them seemed to work. Any ideas?

Jan 1 in Selenium by Sebastian
• 180 points

recategorized Jan 1 by Vardhan 399 views

Hey @sebastian, here you can try using 

driver.findElement(By.linkText("Get Your Coupon")).click();
@sebastian did it work?

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Selenium

0 votes
2 answers

Python & Selenium: How to find and click on YouTube's Like button

Hello Nitin, as the Like button on ...READ MORE

answered Aug 23 in Selenium by Abha
• 23,030 points
591 views
0 votes
1 answer

Can't find an element Using Selenium

The reason you can't locate the item ...READ MORE

answered Mar 26, 2018 in Selenium by nsv999
• 5,090 points
300 views
0 votes
3 answers

How to specify "ENTER" button functionality in Selenium WebDriver code?

using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); ...READ MORE

answered Feb 12 in Selenium by anonymous
8,990 views
0 votes
1 answer
0 votes
1 answer

Python + Selenium - Trying to find element by link containing certain words

2 issues. One thing is, "Catalogues" & ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,090 points
3,877 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

Hey Hemant, for installing Selenium Webdriver with ...READ MORE

answered May 8 in Selenium by Anvi
• 12,860 points
146 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
592 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
901 views