semantics of click() - blocking or non-blocking?

440 views
Skip to first unread message

Eric Allen

unread,
Feb 7, 2010, 8:31:41 PM2/7/10
to selenium-...@googlegroups.com
Hi,
I'm fairly new to WebDriver and I've been experimenting with the JSAPI for interacting with WebDriver directly from JavaScript in the same browser. In the process, I've uncovered what seems to be an inconsistency in the semantics of WebElement.click().

Is the click() method supposed to block until the next page loads if the click event causes an HTTP request? From the code, it appears that it will not block if using native events, but it will try to block when using synthesized events.

In Firefox 3.5.7 on OS X 10.6.2, click() is using non-native events, yet still failing to block properly. After poking around with Venkman and dump(), it looks to me like webProgress.isLoadingDocument is returning false all the way from when the click event fires to when the page finishes loading. A bug in Firefox, or am I confused?

Regardless of whether click()'s blocking is buggy at the moment, I'm still unclear on whether it even should be blocking. Is there clear documentation somewhere about the semantics of various WebDriver commands?

-Eric

ponto

unread,
Feb 23, 2010, 1:33:35 PM2/23/10
to Selenium Developers
see this http://selenium.googlecode.com/svn/trunk/docs/api/java/index.html
and this code example: http://seleniumexamples.com/blog/examples/selenium-2-examples/

On Feb 8, 1:31 am, Eric Allen <ericpal...@gmail.com> wrote:
> Hi,
> I'm fairly new to WebDriver and I've been experimenting with the JSAPI for interacting with WebDriver directly from JavaScript in the same browser. In the process, I've uncovered what seems to be an inconsistency in the semantics of WebElement.click().
>

> Is theclick() method supposed toblockuntil the next page loads if theclickevent causes an HTTP request? From the code, it appears that it will notblockif using native events, but it will try toblockwhen using synthesized events.
>
> In Firefox 3.5.7 on OS X 10.6.2,click() is using non-native events, yet still failing toblockproperly. After poking around with Venkman and dump(), it looks to me like webProgress.isLoadingDocument is returning false all the way from when theclickevent fires to when the page finishes loading. A bug in Firefox, or am I confused?
>
> Regardless of whetherclick()'s blocking is buggy at the moment, I'm still unclear on whether it even should be blocking. Is there clear documentation somewhere about the semantics of various WebDriver commands?
>
> -Eric

ponto

unread,
Feb 23, 2010, 1:34:50 PM2/23/10
to Selenium Developers
oh, wrong javadoc's link. check this one
http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/support/ui/WebDriverWait.html

On Feb 8, 1:31 am, Eric Allen <ericpal...@gmail.com> wrote:

> Hi,
> I'm fairly new to WebDriver and I've been experimenting with the JSAPI for interacting with WebDriver directly from JavaScript in the same browser. In the process, I've uncovered what seems to be an inconsistency in the semantics of WebElement.click().
>

> Is theclick() method supposed toblockuntil the next page loads if theclickevent causes an HTTP request? From the code, it appears that it will notblockif using native events, but it will try toblockwhen using synthesized events.
>
> In Firefox 3.5.7 on OS X 10.6.2,click() is using non-native events, yet still failing toblockproperly. After poking around with Venkman and dump(), it looks to me like webProgress.isLoadingDocument is returning false all the way from when theclickevent fires to when the page finishes loading. A bug in Firefox, or am I confused?
>
> Regardless of whetherclick()'s blocking is buggy at the moment, I'm still unclear on whether it even should be blocking. Is there clear documentation somewhere about the semantics of various WebDriver commands?
>
> -Eric

Eric Allen

unread,
Feb 24, 2010, 10:09:38 AM2/24/10
to selenium-...@googlegroups.com
Oh awesome. Right there in the Javadoc. Thanks!

If click() causes a new page to be loaded via an event or is done by sending a native event (which is a common case on Firefox, IE on Windows) then the method will *not* wait for it to be loaded and the caller should verify that a new page has been loaded.

--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.


Reply all
Reply to author
Forward
0 new messages