- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Cannot click on button
Fri Apr 06, 2012 3:29 pm
Hello, I have a button defined with
This click should create new user and take me to another page. But, click doesn't happen, button just gets new look as selected (changes "class="buttonTitle" to " class="buttonTitleOver").
Any idea what's wrong here?
- Code:
<td align="center" valign="center" nowrap="true" onfocus="isc_IButton_3_label.$47()" tabindex="-1" style="padding-top:0px;padding-bottom:0px;" class="buttonTitle" id="">Create</td>
- Code:
click scLocator=//IButton[ID="isc_IButton_3"]/
This click should create new user and take me to another page. But, click doesn't happen, button just gets new look as selected (changes "class="buttonTitle" to " class="buttonTitleOver").
Any idea what's wrong here?
- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO
Re: Cannot click on button
Fri Apr 06, 2012 11:13 pm
Do you get any errors? I would try adding 'AndWait' to click, just to see if that makes a difference
- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Re: Cannot click on button
Sat Apr 07, 2012 12:36 am
No errors, test passed as successful. I did try ClickAndWait command, but the same thing happened again.
- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO
Re: Cannot click on button
Mon Apr 09, 2012 10:42 am
You said the click isn't happening, but the test is passing? It sounds like the click is happening, but the action to create a new user isn't. Does this work when you manually click on it? Could you try slowing your script down and see if that does it? Also another thing I would try is putting a break point just before the click. Then manually click on it and see if it works.
- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Re: Cannot click on button
Tue Apr 10, 2012 5:17 pm
Yes, it works when I click manually, but not during the test - when I slow test down, add breakpoint and click manually on the button like you said, it doesn't work, action to create user is not done and I stay on the same page.
- roscoActive particpant
- Posts : 20
Join date : 2012-04-05
Re: Cannot click on button
Tue Apr 10, 2012 10:19 pm
Because of onfocus, have you tried to repeat the action ? (1 is for onfocus and 1 for the real validate action)
- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Re: Cannot click on button
Tue Apr 10, 2012 10:20 pm
I tried to repeat it several times, yes...
Forgot to mention, I run into this: http://www.rhq-project.org/pages/viewpage.action?pageId=5800438
Scroll down, there is a sentence "I can't get the a click on the Cancel button to take action. The button highlights and that is it.". I don't quite understand what was the test case and workaround, but...could it be a bug in Selenium?
Forgot to mention, I run into this: http://www.rhq-project.org/pages/viewpage.action?pageId=5800438
Scroll down, there is a sentence "I can't get the a click on the Cancel button to take action. The button highlights and that is it.". I don't quite understand what was the test case and workaround, but...could it be a bug in Selenium?
- roscoActive particpant
- Posts : 20
Join date : 2012-04-05
Re: Cannot click on button
Thu Apr 12, 2012 6:25 pm
May be you can try this, before click operation,
fireEventAndWait | scLocator=//IButton[ID="isc_IButton_3"]/ | focus
keep us updated
fireEventAndWait | scLocator=//IButton[ID="isc_IButton_3"]/ | focus
keep us updated
- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Re: Cannot click on button
Thu Apr 12, 2012 6:59 pm
It gives me timeout on this line
[info] Executing: |fireEventAndWait | scLocator=//IButton[ID="isc_IButton_3"]/ | focus |
[error] Timed out after 30000ms
But, there is also error at the end that says
[error] Error: There was an unexpected Alert! [Lead Number cannot be null; project alias cannot be null; project name cannot be null; lead number is not unique; ]
even though those fields seem to be filled correctly in the GUI...really strange
[info] Executing: |fireEventAndWait | scLocator=//IButton[ID="isc_IButton_3"]/ | focus |
[error] Timed out after 30000ms
But, there is also error at the end that says
[error] Error: There was an unexpected Alert! [Lead Number cannot be null; project alias cannot be null; project name cannot be null; lead number is not unique; ]
even though those fields seem to be filled correctly in the GUI...really strange
- roscoActive particpant
- Posts : 20
Join date : 2012-04-05
Re: Cannot click on button
Thu Apr 12, 2012 7:24 pm
And if you use just fireEvent ?
- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Re: Cannot click on button
Thu Apr 12, 2012 7:54 pm
This time no timeout, but also still no action
- roscoActive particpant
- Posts : 20
Join date : 2012-04-05
Re: Cannot click on button
Thu Apr 12, 2012 8:11 pm
Could you explain me what means : scLocator=//IButton[ID="isc_IButton_3"]/
I'm not an expert with scLocator.
Does it means the td element has the id="isc_IButton_3" ? (dynamicaly set)
I'm not an expert with scLocator.
Does it means the td element has the id="isc_IButton_3" ? (dynamicaly set)
- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Re: Cannot click on button
Thu Apr 12, 2012 8:16 pm
I'm also not very familiar with it. This is what I get when I record the manual click with Selenium IDE.
Yes, I think so. My button looks like this (I didn't implement it so I don't know why has it been done this way):
Yes, I think so. My button looks like this (I didn't implement it so I don't know why has it been done this way):
- Code:
<div id="isc_5P" onscroll="return isc_IButton_3.$lh()" style="position: absolute; left: 67px; top: 452px; width: 92px; height: 22px; z-index: 200667; -moz-box-sizing: border-box; overflow: hidden; cursor: pointer; outline-style: none;" tabindex="-1" onblur="if(window.isc)isc.EH.blurFocusCanvas(isc_IButton_3_label,true);" onfocus="if(event.target!=this)return;isc.EH.focusInCanvas(isc_IButton_3_label,true);" role="label" eventproxy="isc_IButton_3">
<div id="isc_5Q" style="position: relative; visibility: inherit; z-index: 200667; cursor: pointer;" eventproxy="isc_IButton_3">
<table id="" width="100%" height="100%" cellspacing="0" cellpadding="0" style="table-layout:fixed;overflow:hidden;">
<tbody>
<tr>
<td id="" class="buttonTitle" align="center" valign="center" nowrap="true" onfocus="isc_IButton_3_label.$47()" tabindex="-1" style="padding-top:0px;padding-bottom:0px;">Create</td>
</tr>
</tbody>
</table>
</div>
</div>
- roscoActive particpant
- Posts : 20
Join date : 2012-04-05
Re: Cannot click on button
Thu Apr 12, 2012 9:06 pm
So, my last contribution :-)
The problem is to identify your element, that changes dynamicaly
may be with this selector css=td.buttonTitle and css=td.buttonTitleOver
Try
click css=td.buttonTitle
click css=td.buttonTitleOver
The problem is to identify your element, that changes dynamicaly
may be with this selector css=td.buttonTitle and css=td.buttonTitleOver
Try
click css=td.buttonTitle
click css=td.buttonTitleOver
- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Re: Cannot click on button
Thu Apr 12, 2012 9:18 pm
Same thing happens with both - button highlights but no action
Anyway, thanks a lot for your help, I really appreciate it
If I by some miracle find the solution, I'll definitelly post it here...
Anyway, thanks a lot for your help, I really appreciate it
If I by some miracle find the solution, I'll definitelly post it here...
Re: Cannot click on button
Fri Apr 13, 2012 11:33 am
Having looked at your HTML I see neither tag "IButton" nor id - "isc_IButton_3"
but if it is not the right element then you must have got element not found exception, which your don't so I doubt the html which you have posted.
Also have you tried executing js to invoke click, i.e. -
selenium.getEval("window.document.getElementById(''isc_IButton_3").click");
but if it is not the right element then you must have got element not found exception, which your don't so I doubt the html which you have posted.
Also have you tried executing js to invoke click, i.e. -
selenium.getEval("window.document.getElementById(''isc_IButton_3").click");
- TrillianActive particpant
- Posts : 14
Join date : 2012-03-30
Re: Cannot click on button
Fri Apr 13, 2012 3:31 pm
Thanks...Currently I'm working on something else but when I get some time I'll try this and let you know...
- How do i get the Xpath value for a radio button so i can click the button on a form
- Select the “back” button of the Firefox browser to right click and Select the Option from the right click Menu in Selenium Web Driver - Java
- click button of a pop up in webdriver
- Click on a button with no Id using Webdriver
- My Xpath won't click the button on webpage
Permissions in this forum:
You cannot reply to topics in this forum