This is a migrated thread and some comments may be shown as answers.

Page loading/read verification etc.

4 Answers 123 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SD
Top achievements
Rank 1
SD asked on 14 Jul 2010, 07:21 AM
Hi Guys, 

Using Nunit, FF (3.0.19), VSE 08. 

I'm using the following code to click a button (AJAX buttons are handled  in a slightly different way..):
public void ClickButtonByGUICaption(String buttonGUIName)
   {
       StringBuilder buffer = new StringBuilder();
       buffer.Append("//input[@value=\"")
             .Append(buttonGUIName)
             .Append("\"]");

       Manager.ActiveBrowser.Find.ByXPath<HtmlInputSubmit>(buffer.ToString()).Click();
       Manager.ActiveBrowser.WaitUntilReady();
   }
The above works well at most scenarios except a few in which the above is followed by an assertation  of some kind as 
check if txt exists ext. 
The test passes however when 'executionDelay'  value is increased from 100-150 to 800 or more, indicating the issue is not the code (In a sense that I'm not looking for the wrong element etc). 

Am I using/understanding WaitUntilReady method wrongly ? My assumption is that if WaitUntilReady
is the last action the ClickButtonByGUICaption ()initiates, there should be no issues initiating any kind of verification/action past that point on the page that loads as the page is supposed to be ready. Does ready = fully loaded ?

Pls note that using WaitForElement/Frame maybe quite tedious in my case as I have a large number of situations so I need to use a more generic solution as the above. 

Ta, 
SD. 
 














4 Answers, 1 is accepted

Sort by
0
Missing User
answered on 19 Jul 2010, 05:27 PM
Hello SD,

WaitUntilReady() returns when the browser reports that it is ready. This is dependent on the browser being used itself, it's not something WebAii can control. 

ExecutionDelay will just delay the entire test in general. If you have an assertion on something on the page and it is failing with a time out or null reference, you would have to add something like:

HtmlControl c = ...
c.Wait.ForVisible();

Kind regards,
Nelson sin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
SD
Top achievements
Rank 1
answered on 29 Jul 2010, 01:14 AM
Ta Nelson, 

What is wrong with the following (Won't compile) ...Is this the right implementation ?
HtmlInputButton acce = Manager.ActiveBrowser.Find.ByXPath<HtmlInputButton>("//input[@value=\"Acceptable\"]");
 
Manager.ActiveBrowser.WaitForElement(acce, 1000);

What's the difference between the above and 'Wait.ForVisible()' ?

Ta, 

SD.
0
Missing User
answered on 29 Jul 2010, 11:00 PM
Hi again SD,

The WaitForElement() would require a FindExpression like the following:

ActiveBrowser.WaitForElement(new HtmlFindExpression("XPath=//input[@value=\"Acceptable\"]"), 10000);

You might be able to use HtmlWaitClass for this also.

Greetings,
Nelson
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
SD
Top achievements
Rank 1
answered on 30 Jul 2010, 05:43 AM
Thanks a bunch Nelson, problem solved. 

Tags
General Discussions
Asked by
SD
Top achievements
Rank 1
Answers by
Missing User
SD
Top achievements
Rank 1
Share this question
or