Page 1 of 1

Automation Testing

Posted: Thu Dec 13, 2012 12:36 am
by michaelperon
How do we create a script or code for a page that loads and fails test? Mainly because of ranorex is not recognizing the page loading or timing out in the replay

1.) do I create a variable?

2.)any suggestions or work around?

Re: Automation Testing

Posted: Thu Dec 13, 2012 3:09 pm
by Support Team
Hello,

If I understand your use case correctly you want to test if a specific web page can be loaded.
Please clarify what you want to do.

You could create a 'Simple Data Connector' and add a value for each URL you want to test. Then, you create a variable (e.g. WebPage) for the domain object and use it within a repository item (/dom[domain=$webpage]). Finally, you need to bind this variable.

In the Recording, you need two actions: one for open the browser with the URL and one for a Report log (as shown below:
public void Report_Log()
{
	var page = repo.WebPageTest;
	Report.Info(page.Self.Path);
}
You'll get an error message if the webpage is not loaded.
You could also add a validation step which checks if a specific element exist.
You should choose an element which is shown when the page is successfully loaded.

Regards,
Markus (T)