trying to validate information on top panel

Class library usage, coding and language questions.
EricTcg
Posts: 9
Joined: Mon Aug 20, 2012 7:36 pm
Location: Powers lake, WI
Contact:

trying to validate information on top panel

Post by EricTcg » Tue Feb 26, 2013 5:49 pm

The program that i am working with has multiple panels stacked on top of each other that are all populated at the same time. I am trying to run this code to see if certain things exist on the panel.

Code: Select all

			if(repo.BeaconClient.PotentialEquivalentsInStock.OriginalDrugDescriptionInfo.Exists())
			{
				EquivTest.Start();
				Pick.Start();
			}
			else if(repo.BeaconClient.PnlMain.RxRX15046522BBrandLEVOTHYROXINESOInfo.Exists())
			{
				
				Pick.Start();
			}
			
Since the Panels are populated before i get to this part of the code it is will never make it to the else if part of the code. So is there a way that i can find the top panel so that i can get to the second part of the code?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: trying to validate information on top panel

Post by Support Team » Wed Feb 27, 2013 5:31 pm

Hello,

You can use the Validate class.
Please read the following section in our user guide to get more information how to use this class: http://www.ranorex.com/support/user-gui ... html#c3203

Regards,
Bernhard
.
Image

EricTcg
Posts: 9
Joined: Mon Aug 20, 2012 7:36 pm
Location: Powers lake, WI
Contact:

Re: trying to validate information on top panel

Post by EricTcg » Wed Feb 27, 2013 9:07 pm

I have followed what you guys have given me and i did some searching. I am having one problem when i do the validation when it search's for what is not there it fails the whole test and i would like it to continue. the code below is what i have, Am i doing something wrong?

Code: Select all

Validate.Exists(repo.BeaconClient.PnlMain.PotentialEquivalentsInStock,"Check Object '{0}'" , false)

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: trying to validate information on top panel

Post by Support Team » Thu Feb 28, 2013 5:44 pm

Hello,

Plese try something like this. I used the repository item from the "Windows Start" button for this example.
if(Validate.NotExists(repo.Start.StartInfo,"Check Object '{0}'" , new Validate.Options(false, ReportLevel.Warn)))
{
     Report.Info("Do something");
}
     else
{
     Report.Info("Do something else");
}
I hope this will help you.

Regards,
Bernhard
.
Image

EricTcg
Posts: 9
Joined: Mon Aug 20, 2012 7:36 pm
Location: Powers lake, WI
Contact:

Re: trying to validate information on top panel

Post by EricTcg » Thu Feb 28, 2013 6:25 pm

Thank you. This worked for me.

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: trying to validate information on top panel

Post by omayer » Thu Feb 28, 2013 10:21 pm

Hi Bernhard,
How would i do with this same code using xpath instead of repo .
Thank you
Tipu

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: trying to validate information on top panel

Post by Ciege » Thu Feb 28, 2013 10:59 pm

omayer wrote:Hi Bernhard,
How would i do with this same code using xpath instead of repo .
Thank you
Look at the online API for the Validate Class.
Your answer is there...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...