Clicking a button which is disabled by default and attribute change using Webdriver

88 views
Skip to first unread message

Aquasush

unread,
Jan 27, 2014, 4:24:59 PM1/27/14
to seleniu...@googlegroups.com
Hi Team,
I am working on UI automation of  web application using Webdriver. I have a  "Next" button which is disabled by default. But when a checkbox is selected the button "disabled" attribute disappears and it can be clicked to go to next page. Im trying to achieve this using webdriver. But none seem to work. Im using Java, eclipse,Testng framework on Windows 8,and using Selenium 2.39 version and Firefox 26.0 browser.It could be great if someone really helps me out to move further.
 
PLease find the HTML for the button
<button id="pt1:r1:0:pt1:cb2" class="btn-primary af_commandButton p_AFDisabled p_AFTextOnly" disabled="">Next</button>
Once the checkbox is selected the HTML of the button changes to
<button id="pt1:r1:0:pt1:cb2" class="btn-primary af_commandButton p_AFTextOnly" onclick="return false;">Next</button>
 
Please help.

Alexra

unread,
Feb 7, 2014, 7:33:42 AM2/7/14
to seleniu...@googlegroups.com
Have you tried to wait some seconds before you click?

nani.thrinath.info

unread,
Feb 8, 2014, 8:26:41 AM2/8/14
to seleniu...@googlegroups.com
Use Implicit/Explicit wait, Should work!

Regards,
Chava Thrinath


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/b0ee2d2f-3645-4e68-ac5c-dcc14256c558%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Regards,
Thirnath
Reply all
Reply to author
Forward
0 new messages