XPath Question

Ask general questions here.
StuByZurich
Posts: 18
Joined: Fri Jan 23, 2009 2:04 pm

XPath Question

Post by StuByZurich » Mon Feb 16, 2009 2:42 pm

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

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

Post by Support Team » Mon Feb 16, 2009 4:24 pm

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

StuByZurich
Posts: 18
Joined: Fri Jan 23, 2009 2:04 pm

Post by StuByZurich » Mon Feb 16, 2009 4:46 pm

Thanks for your help.
It seems, that this the rease was :-))

Oliver