cancel
Showing results for 
Search instead for 
Did you mean: 

How do you wait for a page to load in TestLeft?

Highlighted
New Contributor

How do you wait for a page to load in TestLeft?

Hi,

I'm using TestLeft with visual studio C#.  I need to get my code to wait for the web page to load.  I don't want to use hard delays (e.g.  Thread.Sleep(2000) ).   Does anybody have any examples of how to do this?

 

Thanks,

Jamie.

1 REPLY 1
Highlighted
Moderator

Re: How do you wait for a page to load in TestLeft?

Hi Jamie,

 

You can use the IWebPage.Wait method. Here is a simple example:

 

IWebPage page = Driver.Find<IWebBrowser>(new WebBrowserPattern()
{
ObjectIdentifier = "chrome"
}).Find<IWebPage>(new WebPagePattern()
{
URL = "https://community.smartbear.com/t5/TestLeft/How-do-you-wait-for-a-page-to-load-in" +
"-TestLeft/m-p/119673",
ObjectGroupIndex = 0
});
/*...*/
page.Wait(1000);

 

Julia Bernikova
SmartBear Customer Care Product Lead - TestComplete
New Here?
Join us and watch the welcome video:
Labels