Page 1 of 1

XPath Question

Posted: Mon Feb 16, 2009 2:42 pm
by StuByZurich
Hi again,

I am currently working on webtest witout the recorder.
But I have a lot of problems with the RanorexXPath.

I think I should know how XPath generally works ;-)

Here a little problem, which I obeserved more than one time:

I created a webDocument which works.
Then I tried to get the object by a shorter XPath-Syntax. Not that long xpath-syntax generated by ranorex-spy.
But the ATag element will be not found.
I tried it also with different xpath-syntax, but always without success.
Normaly every element on my webpage has an unique id-attribute, so I tried it to find it direct by attribute-id.
But also without success.

Code: Select all

            webDocument = @"/dom[@caption~'^Ferienwohnung']";
            ATag lnkRegisterAvailability = webDocument.FindSingle<ATag>(@".//div[@class='objectDetailsWrapper']/ul/li[2]/a");
What do I wrong????

Regards,
Oliver

Posted: Mon Feb 16, 2009 4:24 pm
by Support Team
This is a bug in Ranorex V2.0.0: when you use the FindSingle method without specifying a timeout explicitly, the search is cancelled when the Adapter.DefaultSearchTimeout is reached. This will be fixed in the V2.0.1 release so that FindSingle will search for the path at least one time if no timeout is specified explicitly.

Meanwhile, please try to set Adapter.DefaultSearchTimeout to some high value (e.g. TimeSpan.MaxValue)!

Regards,
Alex
Ranorex Support Team

Posted: Mon Feb 16, 2009 4:46 pm
by StuByZurich
Thanks for your help.
It seems, that this the rease was :-))

Oliver