Testing links : Automation API

Testing links

Class library usage, coding and language questions.

Testing links

Postby anzacthecat » Tue Mar 01, 2011 12:30 pm

I have a webpage which contains a number of links.For each one, I want to click on the link which opens a new window. I then want to check that an appropriate page shows (report screenshot) and close the window before clicking on the next link on the original page. The question is, how do I identify the new window that opens so that I can screenshot it and close it?
anzacthecat
 
Posts: 29
Joined: Mon Jan 10, 2011 2:05 pm

Re: Testing links

Postby Support Team » Tue Mar 01, 2011 2:03 pm

Hi,

you can iterate thru your tabPages via a foreach statement.
In this statement you can click on the tab, make a screenshot and close the specified tab.
The code should look something like this:

IList<Ranorex.TabPage> tabPageList = repo.IE.Self.Find<Ranorex.TabPage>("./Path/to/your/tabpage");
foreach (Ranorex.TabPage tab in tabPageList)
{
	tab.Click();
	Report.Screenshot();
	Keyboard.Press("{LControlKey down}{Wkey}{LControlKey up}");
}


Regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests

cron