Testing
web applicaton fast and more responsive by exchanging data with the server.
For loading a page time is not fixed.(i.e 200 ms or 20 secs.)
current page.This reduces the time between sending the request and seeing the result on the page because it saves time takes by reloading the entire page.
Gmail is the prefect example of
When we click on arrow it does not reload entire page instead it refresh the web clicp header only.
Suppose we have an web application cotaining one text field and button. Once we click on the button text field reflectes with the result comes from the server.
In some case pause will work but its not a permanent workaround because we dont know how much time server will take to respond. It might repsond withing millseconds or might respond in more than 20 secs.
When selenium does not how long to wait for the result then how can we test these kind of application.
Wait For It...
So how do we get Selenium to wait for the result? One way to solve the problem is to use the clickAndWait command instead of click; the "AndWait" suffix indicates that Selenium should wait for a page-reload. This might seem like it would work, but there's a catch: because the page is not reloaded, clickAndWait will make Selenium keep waiting forever. This clearly isn't going to work.
Fortunately Selenium has provided support for doing exactly what we want. When a field value changes in the current page, you can use the waitForValue command to make Selenium wait until the expected value appears.
When executing this command, Selenium will suspend the execution of current test case and wait for the expected value. When the string "newValue" appears in the text field, the suspended test will go on. One thing to note: if you misspelled the expected value, Selenium will wait for 30 seconds before timing out.
As you may have already guessed, there are lots more commands that can be used to test



2 comments:
Hi NIRAJ, Can you please leave some sample codes. They will be of great help.
Thanks
Ankit
Post a Comment