Page 1 of 1

Validate exists returns false when using rxpath

Posted: Mon Jan 07, 2013 9:24 am
by fimo420
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.

Re: Validate exists returns false when using rxpath

Posted: Mon Jan 07, 2013 5:11 pm
by Support Team
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

Re: Validate exists returns false when using rxpath

Posted: Tue Jan 08, 2013 10:45 am
by fimo420
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

Re: Validate exists returns false when using rxpath

Posted: Tue Jan 08, 2013 3:55 pm
by Support Team
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)

Re: Validate exists returns false when using rxpath

Posted: Tue Jan 08, 2013 4:44 pm
by fimo420
Hi again,

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

Thanks
/Feroz

Re: Validate exists returns false when using rxpath

Posted: Tue Jan 08, 2013 5:12 pm
by Support Team
Hello,

You are welcome :-)

Regards,
Markus (T)