Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Cannot click on button

View previous topic View next topic Go down

Cannot click on button

Post by Trillian on 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?

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by ccox on 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

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: Cannot click on button

Post by Trillian on Sat Apr 07, 2012 12:36 am

No errors, test passed as successful. I did try ClickAndWait command, but the same thing happened again.

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by ccox on 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.

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: Cannot click on button

Post by Trillian on 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.

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by rosco on 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)

rosco
Active particpant
Active particpant

Posts : 20
Join date : 2012-04-05

Back to top Go down

Re: Cannot click on button

Post by Trillian on 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?

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by rosco on 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

rosco
Active particpant
Active particpant

Posts : 20
Join date : 2012-04-05

Back to top Go down

Re: Cannot click on button

Post by Trillian on 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

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by rosco on Thu Apr 12, 2012 7:24 pm

And if you use just fireEvent ?

rosco
Active particpant
Active particpant

Posts : 20
Join date : 2012-04-05

Back to top Go down

Re: Cannot click on button

Post by Trillian on Thu Apr 12, 2012 7:54 pm

This time no timeout, but also still no action

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by rosco on 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)

rosco
Active particpant
Active particpant

Posts : 20
Join date : 2012-04-05

Back to top Go down

Re: Cannot click on button

Post by Trillian on 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>

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by rosco on 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

rosco
Active particpant
Active particpant

Posts : 20
Join date : 2012-04-05

Back to top Go down

Re: Cannot click on button

Post by Trillian on 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...

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by tarun3kumar on 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");

_________________
Thanks
Tarun K
Free Selenium Training

tarun3kumar
Master
Master

Posts : 186
Join date : 2012-02-14

http://seleniumtests.com

Back to top Go down

Re: Cannot click on button

Post by Trillian on 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...

Trillian
Active particpant
Active particpant

Posts : 14
Join date : 2012-03-30

Back to top Go down

Re: Cannot click on button

Post by Sponsored content Today at 8:11 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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