Automation Testing

Ranorex Studio, Spy, Recorder, and Driver.
michaelperon
Posts: 2
Joined: Sat Nov 10, 2012 7:22 pm

Automation Testing

Post by michaelperon » Thu Dec 13, 2012 12:36 am

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Automation Testing

Post by Support Team » Thu Dec 13, 2012 3:09 pm

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)