Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty Cannot click on button

Fri Apr 06, 2012 3:29 pm
Hello, I have a button defined with
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>
When I record the test with Selenium IDE, it saves click on the button this way:
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?
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO

Cannot click on button Empty 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
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty 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.
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO

Cannot click on button Empty 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.
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty 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.
avatar
rosco
Active particpant
Active particpant
Posts : 20
Join date : 2012-04-05

Cannot click on button Empty 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)
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty 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?
avatar
rosco
Active particpant
Active particpant
Posts : 20
Join date : 2012-04-05

Cannot click on button Empty 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
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty 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
avatar
rosco
Active particpant
Active particpant
Posts : 20
Join date : 2012-04-05

Cannot click on button Empty Re: Cannot click on button

Thu Apr 12, 2012 7:24 pm
And if you use just fireEvent ?
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty Re: Cannot click on button

Thu Apr 12, 2012 7:54 pm
This time no timeout, but also still no action
avatar
rosco
Active particpant
Active particpant
Posts : 20
Join date : 2012-04-05

Cannot click on button Empty 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)
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty 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):
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>
avatar
rosco
Active particpant
Active particpant
Posts : 20
Join date : 2012-04-05

Cannot click on button Empty 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
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty Re: Cannot click on button

Thu Apr 12, 2012 9:18 pm
Same thing happens with both - button highlights but no action Sad

Anyway, thanks a lot for your help, I really appreciate it Smile
If I by some miracle find the solution, I'll definitelly post it here...
avatar
tarun3kumar
Master
Master
Posts : 186
Join date : 2012-02-14
http://seleniumtests.com

Cannot click on button Empty 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");
avatar
Trillian
Active particpant
Active particpant
Posts : 14
Join date : 2012-03-30

Cannot click on button Empty 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...
Sponsored content

Cannot click on button Empty Re: Cannot click on button

Back to top
Permissions in this forum:
You cannot reply to topics in this forum