Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

The application that am working on was recently revamped and as part of that a new JQuery calendar was introduced. I need to click on a link in the calendar to select the time and date. However, Selenium.click is not working. The command gets executed, but nothing happens on the screen.

To check whether my XPATH/CSS locator (I tried both) is correct, I added selenium.getText(locator) and selenium.highlight(locator) commands. Both worked!. No issues in that. Its ONLY the click that is not working.

Upon checking in firebug, I could see that the div on which I am trying to click is kind of grayed out state. Does it meant that element is disabled? See the screenshot of the firebug below.

I also tried to run the same command in Selenium IDE. In IDE this works "sometimes".

I am running this test using Selenium 1.xx.

I did one more thing as part of debugging. During the test run, I opened the Selenium IDE in the browser so that it records what actions are happening. IDE recorded all actions till this click. But I couldn't see anything in the IDE when the click command was executed. Any idea guys, what would be cause?

Has anyone faced a similar issue before? Any help would be appreciated!!!

EDIT Added screenshot of the calendar. The calendar comes up like a popup on top of the existing window. enter image description here

enter image description here

share|improve this question
    
Have you tried the clickAt(0,0) function? That helps in a lot of cases. –  Hannibal May 27 '11 at 6:24
    
I tried, but would like to confirm whether that is the correct way. Here is what i tried selenium.clickAt("locator",""); Is this correct? –  A.J May 27 '11 at 6:35
    
Nope. That should be selenium.clickAt("locator","0,0"); –  Hannibal May 27 '11 at 8:08
    
I would not suggest using clickAt, as it gets highly dependent on pixel level info on a page. –  Tarun May 27 '11 at 8:51
    
Oh.OK. Anyways, clickAt too didn't work. –  A.J May 27 '11 at 9:20
add comment

4 Answers 4

Though you would be missing testing calendar functionality but if nothing works (as it is not just clicking calendar link but you would also have to navigate to right place in calendar) and it becomes a blocker then try typing directly in text box.

share|improve this answer
    
Guess what, there is no text box :). Selecting is the ONLY way. –  A.J May 27 '11 at 9:19
    
so I assume u make a selection and date appears like text label on page, any way I could access ur app or any similar application on net? –  Tarun May 27 '11 at 11:36
    
Application is currently internal. I can post some screenshots though. –  A.J May 27 '11 at 11:41
add comment

This is a little bit of a long shot, but since this thread doesn't seem to be going anywhere... Usually, when Selenium has problems clicking on things in IE it is because the Zoom Level is not at 100%.

share|improve this answer
add comment

Can you have a try with selenium.mouseDown(TargetLocator)

now 'TargetLocator' can be till the immediate before 'div' of the 'span' OR till the 'span'

please try with both.

share|improve this answer
add comment

I could not get click or clickAndWait to work on a cell in a grid that was generated using EXT.NET too. I was sure that the locator was working because pressing the Find button in the Selenium IDE caused the cell to be briefly highlighted in yellow. I finally tried clickAt and it worked. Here's what I specified:

Command: clickAt
Target: //*[@id='ext-gen336']/div[3]/table/tbody/tr/td[4]/
Value: 0,0

The syntax for clickAt is given as clickAt(locator, coordString). The x,y values for coordString don't seem to matter so I simply used 0,0.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.