0

I am using clickAndWait for xpath=//button[contains(.,'Next')] When I click Find on Selenium IDE the button is found, but the script doesn't click on the button. The button has id = pmc_wizard_next and class = btn btn-next.

The html for the button is:

<div id="pmc_wizard" class="wizard pmc-wizard">
 <ul class="steps pmc-wizard-steps"> ... </ul>
 <div class="actions pmc-wizard-actions">
 <button id="pmc_wizard_prev" class="btn btn-prev"> ... </button>
 <button id="pmc_wizard_next" class="btn btn-next" data-last="Submit">
 Next
 <i class="icon-arrow-right"></i>
 </button>
 </div>
</div>

When the button is clicked, it doesn't navigate to the next page, however it does perform all the actions on the next page.

What should I be doing?

Kate Paulk
31.5k8 gold badges56 silver badges109 bronze badges
asked Sep 16, 2014 at 7:52
3
  • Try using submit() rather than click(). Commented Sep 16, 2014 at 16:34
  • Hi stray. i am using Selenium IDE and submit is not working. i am currently using Command: click and Target: css=button#pmc_wizard_next.btn.btn-next. is there any better way to hit that button? Commented Sep 17, 2014 at 6:11
  • Btw. it turns out my button gets disabled in the middle of the execution and then gets enabled again. i have put in a pause statement when i know its going to be disabled. But still it wont hit the button. Commented Sep 17, 2014 at 10:55

1 Answer 1

1

There are some instances where selenium (watir) refuses to click a link or a button even when the xpath expression is valid and claims it found the object.

In these situations I just use a jquery .click function with the .executeScript method as a work around.

answered Oct 16, 2014 at 17:58
1
  • not working in IE in my case Commented Dec 26, 2016 at 10:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.