0

I am facing intermittent issue in Clicking on a button or a hyperlink on Firefox. I am using webdriver version 2.27 and FF17.

The buttons are simple html button -

<input class="btn" type="button" title="AddP" onclick="navigateToUrl('/p/tyy/SelectSearch?addTo=006y67&retURL=%2F00999yu2Boy9','MM_LIST','addP');" name="addP" value="Add P">

I use locator as : name=addP

For hyperlinks I use locator as : link=hyperlinktext

The Click will not fail with any exception, it will simply highlight the button or link, but not perform the actual click.

The frequency of failure is once in 3 times.

Thanks Sky

Sky
  • 215
  • 1
  • 3
  • 11
  • 1
    Firstly upgrade Selenium to v2.28. Would also be worth downgrading Firefox to an earlier version (16 would be fine), just to see if the issue lies within what version of Firefox you have. – Arran Jan 15 '13 at 14:42
  • @Arran - I was working with FF16, because of issue upgraded and tried in FF17. Will try to use Sel 2.28 now. Thanks. – Sky Jan 16 '13 at 08:34
  • @Arran Sel v2.28 doesn't help – Sky Jan 16 '13 at 11:17

2 Answers2

0

Upgrade to at least Selenium 2.28. There were some bugs for Firefox 17 before that.

Ross Patterson
  • 9,527
  • 33
  • 48
  • I tried 2.28, it doesn't help. Same click is working for multiple test cases, but failing in one. No exception thrown. – Sky Jan 16 '13 at 10:03
0

Here is what i found :

Issue 1: I was using By.linkText("test test").click which should have been By.partialLinkText("test test").click . Thanks to stackoverflow for the answer.

Issue 2: I rewrote the css locators for failed button to start from class of some parent above. For e.g. instead of

css=input[name='j_id0:j_id2:j_id3:j_id4']

I am now using

css=.individualPalette input[name='j_id0:j_id2:j_id3:j_id4']

And it works all the time. I am not sure why??

I am still to rerun my scripts couple of more times to be sure these helps.

Community
  • 1
  • 1
Sky
  • 215
  • 1
  • 3
  • 11