Validate exists returns false when using rxpath

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Validate exists returns false when using rxpath

Post by fimo420 » Mon Jan 07, 2013 9:24 am

Hi,

I'm trying to verify if a wpf window exists on screen with validate.exists().
It works fine when i send in an element, or repoinfo item.
But when i send in an rxpath or string item it always returns false, even though the item is there.
My code:
I recieve a

rxpath: "/form[@name='Main Window - GPI']"
bool exists= Validate.Exists(rxPath, timeout, "Check Object '{0}'",new Validate.Options(false, ReportLevel.Warning));

Why do i always get false in this=?
Am i missing something??
The item is there, it works if i just call:

Validate.Exists(repo.iteminfo);

I need to validate with rxpath so that i can set searchtimeout.
really appreciate if anyone could help me in the right direction.

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

Re: Validate exists returns false when using rxpath

Post by Support Team » Mon Jan 07, 2013 5:11 pm

Hello,

This should work except the ReportLevel part.
bool exists= Validate.Exists(rxPath, timeout, "Check Object '{0}'",new Validate.Options(false, ReportLevel.Warn));
Which value is set for the timeout?
Which version of Ranorex do you use?
Could you please provide us with more information about your code, or could you provide us with a code snippet and a snapshot file from the application?
Thank you!

Regards,
Bernhard
.
Image

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Validate exists returns false when using rxpath

Post by fimo420 » Tue Jan 08, 2013 10:45 am

Hi,

I've tried with both ranorex 3 and 4.
timout is set to 2, int value

Im just calling this specific method by sending in rxPath and timeout value.
And it always returns false!

Not sure what more information i can tell.
Its pretty basic.

Im attaching my simple project with a snapshot included from ranorex 3 project.
Let me know if you need anything more from me?

Br,
Feroz
Attachments
validate.zip
(1.37 MiB) Downloaded 222 times

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

Re: Validate exists returns false when using rxpath

Post by Support Team » Tue Jan 08, 2013 3:55 pm

Hello,

It looks like a timing issue.
Please try to increase the timeout to 500 ms.

Please let me know if it makes any difference in your test.

Regards,
Markus (T)
.
Image

fimo420
Posts: 55
Joined: Wed Jun 20, 2012 9:49 am

Re: Validate exists returns false when using rxpath

Post by fimo420 » Tue Jan 08, 2013 4:44 pm

Hi again,

hmm thanks :)
i thought it was seconds, but i guess its ms.
need to read the details more :)

Thanks
/Feroz

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

Re: Validate exists returns false when using rxpath

Post by Support Team » Tue Jan 08, 2013 5:12 pm

Hello,

You are welcome :-)

Regards,
Markus (T)
.
Image