Forum Discussion
AlexKaras
12 years agoChampion Level 3
Hi,
> [...] in other tools which i have already implemented, because internally they are checking whether page gets loaded fully or not [...]
As I mentioned in my original reply, this will work only for the static pages. Criterion for the static page to be considered to be fully downloaded is that the number of bytes received from the server equals to the number specified in the server's response header.
But if the page is dynamic (e.g. AJAX-based), this criterion will not work, because the script received from the server will be executed in the browser and partially update web page's content without reloading the whole page.
Another note: if you, as a tester and developer, is saying that you don't know the url web browser will navigate to after you click the link, how can TestComplete determine this? What logic should it use to decide whether to wait or not? (Remember, that the link can be not a static address, but a call to some script that will do a navigation based on its internal logic.)
Considering the above two notes, can you formulate the reliable criteria (don't forget about the performance as well) that TestComplete can follow to determine if the page was loaded and whether it contains the element you are going to work with?
(One more simple and obvious example: consider the file download page with the countdown that is replaced with the link to the file after it reaches zero. When the page can/should be considered to be fully downloaded? After the countdown appeared on the page? Or when it was replaced with the link?)
Summarizing and repeating what was said above: in modern dynamic web applications it is only you who knows what is expected to happen after some element of the page was clicked (or hovered, or selected) and it is only you who knows when to consider the page to be enough loaded so that your script can continue. And thus it is your responsibility to check these conditions and continue only when page is ready.
> [...] in other tools which i have already implemented, because internally they are checking whether page gets loaded fully or not [...]
As I mentioned in my original reply, this will work only for the static pages. Criterion for the static page to be considered to be fully downloaded is that the number of bytes received from the server equals to the number specified in the server's response header.
But if the page is dynamic (e.g. AJAX-based), this criterion will not work, because the script received from the server will be executed in the browser and partially update web page's content without reloading the whole page.
Another note: if you, as a tester and developer, is saying that you don't know the url web browser will navigate to after you click the link, how can TestComplete determine this? What logic should it use to decide whether to wait or not? (Remember, that the link can be not a static address, but a call to some script that will do a navigation based on its internal logic.)
Considering the above two notes, can you formulate the reliable criteria (don't forget about the performance as well) that TestComplete can follow to determine if the page was loaded and whether it contains the element you are going to work with?
(One more simple and obvious example: consider the file download page with the countdown that is replaced with the link to the file after it reaches zero. When the page can/should be considered to be fully downloaded? After the countdown appeared on the page? Or when it was replaced with the link?)
Summarizing and repeating what was said above: in modern dynamic web applications it is only you who knows what is expected to happen after some element of the page was clicked (or hovered, or selected) and it is only you who knows when to consider the page to be enough loaded so that your script can continue. And thus it is your responsibility to check these conditions and continue only when page is ready.
Related Content
Recent Discussions
- 3 days ago