Forum Discussion
tristaanogre
15 years agoEsteemed Contributor
Question1:
I want to use script to make the script wait till the web page is loaded completely, instead of using "Delay" what other option I've?
I more thing I want to mention is... while web page is being loaded... theURL will not change... for example, when I click on submit button the webpage will go to next page, in this situation the URL will not change it will be "http://server1/default.asp" always, so how to make the script wait till the page is loaded completely?
This is pretty easy, actually. After you perform an action against the page, simply call the page object's "Wait method"
pageObj = Aliases.browser.Page("http://www.mysite.com/")
PerformActionAgainstPage
pageObj.Wait()As for your second question... I'm not sure what you're asking... the DDT.CurrentDriver.Next() method is already "looping" the rows... Your while loop uses the "current" row and then, when you call that Next method, it goes to the next row. So, effectively, your rows are looped.
Now, if you mean how to only use the first two rows, all you need to do is add a counter that increments each time through your loop and then, in your "While" statement, add a condition "counter <= 2".