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, 2019 in Selenium by Sebastian
• 180 points

recategorized Jan 1, 2019 by Vardhan 4,169 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, 2019 in Selenium by Abha
• 28,140 points
5,511 views
0 votes
1 answer

Can't find an element Using Selenium

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

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
2,740 views
0 votes
2 answers
0 votes
6 answers

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

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

answered Feb 13, 2019 in Selenium by anonymous
96,267 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 28, 2018 in Selenium by nsv999
• 5,500 points
9,343 views
0 votes
1 answer

Installing Selenium Webdriver with Python package

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

answered May 8, 2019 in Selenium by Anvi
• 14,150 points
15,887 views
0 votes
2 answers

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,500 points
13,776 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,188 views
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,910 points
7,265 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP