Playing back a webdriver script in Firefox 4 behaves weirdly

10 views
Skip to first unread message

nishant verma

unread,
Jun 13, 2011, 6:04:40 AM6/13/11
to Selenium Users
I have a webdriver script which searches for a text in Google and
clicks on the first link.

public void someGoogleSearchFor(String searchKey) throws Exception {
browser.get("http://www.google.com");
browser.findElement(By.name("q")).sendKeys(searchKey);
browser.findElement(By.name("btnG")).submit();
browser.findElements(By.linkText(searchKey)).get(0).click();

}


While playing back in Firefox, it just appends the "searchkey" to the
URL address bar and waits for some time before it fails on the last
step.

OS: Windows 7
Browser: Firefox 4.0.1

When I played it back in IE, it works absolutely fine.

Would appreciate if someone would let me know how to fix it or if
there someone has already faced it.

Thanks,
Nishant Verma
www.nishantverma.com

mike edmister

unread,
Jun 13, 2011, 4:34:36 PM6/13/11
to Selenium Users
I was experiencing the same problem. I can't offer a solution, but
here is a possible workaround in the mean time:
I did notice that calling the same exact browser remotely (using
RemoteWebDriver and capabilities.setBrowserName("firefox")) results in
normal behavior.

Mike

On Jun 13, 6:04 am, nishant verma <nishuve...@gmail.com> wrote:
> I have a webdriver script which searches for a text in Google and
> clicks on the first link.
>
> public void someGoogleSearchFor(String searchKey) throws Exception {
>                 browser.get("http://www.google.com");
>                 browser.findElement(By.name("q")).sendKeys(searchKey);
>                 browser.findElement(By.name("btnG")).submit();
>                 browser.findElements(By.linkText(searchKey)).get(0).click();
>
>         }
>
> While playing back inFirefox, it just appends the "searchkey" to the
> URLaddressbarand waits for some time before it fails on the last
Reply all
Reply to author
Forward
0 new messages