Wait for UI loading to finish using JavaScript?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Wait for UI loading to finish using JavaScript?

ramendik
Hello,

I am working on tests for a Dojo application using Selenium WebDriver.
Sometimes the UI takes considerable time to load fully.

I have found some code for waiting for JQuery to load and for waiting
for Javascript (document.readyState) here:
http://stackoverflow.com/questions/33348600/selenium-wait-for-ajax-content-to-load-universal-approach

Will any of these approaches work for Dojo reliably? And/or, is there
any other reliable way to wait for a Dojo application to load the UI?
The idea is, I need a JavaScript query that will tell me whether the
loading (reaction to latest click, etc) has finished; the rest can be
handled by Java and Selenium.

Thanks!

--
Yours, Mikhail Ramendik

Unless explicitly stated, all opinions in my mail are my own and do
not reflect the views of any organization
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Wait for UI loading to finish using JavaScript?

dylanks
You could look into how Intern (which leverages Selenium WebDriver as well, but with JS APIs for authoring tests rather than Java). There are a few approaches that could work. The simplest is to poll until your app is initialized, by checking for something in your app that indicates that it is done loading.

Dylan Schiemann
SitePen, Inc.
http://www.sitepen.com/
t: 650.968.8787
Sent from my iPhone

> On Mar 8, 2017, at 17:30, Mikhail Ramendik <[hidden email]> wrote:
>
> Hello,
>
> I am working on tests for a Dojo application using Selenium WebDriver.
> Sometimes the UI takes considerable time to load fully.
>
> I have found some code for waiting for JQuery to load and for waiting
> for Javascript (document.readyState) here:
> http://stackoverflow.com/questions/33348600/selenium-wait-for-ajax-content-to-load-universal-approach
>
> Will any of these approaches work for Dojo reliably? And/or, is there
> any other reliable way to wait for a Dojo application to load the UI?
> The idea is, I need a JavaScript query that will tell me whether the
> loading (reaction to latest click, etc) has finished; the rest can be
> handled by Java and Selenium.
>
> Thanks!
>
> --
> Yours, Mikhail Ramendik
>
> Unless explicitly stated, all opinions in my mail are my own and do
> not reflect the views of any organization
> --
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Co-Founder, Dojo Toolkit
CEO, SitePen, Inc.  http://www.sitepen.com/