Problem in accessing the element : General Questions

Problem in accessing the element

Ask general questions here.

Problem in accessing the element

Postby rohitjain3333 » Wed Sep 21, 2011 12:45 pm

I am trying to access the element wwhich has path which ends as " /text[@accessiblevalue='0.000001']"
but at run time the the accessiblevalue changes and it throws exception in finiding the path.
rohitjain3333
 
Posts: 12
Joined: Tue Sep 20, 2011 8:12 am

Re: Problem in accessing the element

Postby Support Team » Wed Sep 21, 2011 1:05 pm

Hi,

It seems that this is a dynamic attribute which changes after each restart of your AUT.
So you have to find a unique attribute to identify the element.
Are there any other attributes available for the element?
For more information please have a look at the following links:

http://www.ranorex.com/support/user-guide-20/ranorexpath.html
http://www.ranorex.com/blog/ranorexpath-tips-and-tricks
http://www.ranorex.com/blog/eliminate-dynamic-attributes-in-generated-ranorexpaths

Regards,
Markus
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Problem in accessing the element

Postby rohitjain3333 » Wed Sep 21, 2011 2:29 pm

how to write a regular expression to find numbers like 0.00001 or 56.
so at run time it will find that element.
i am doing like this Text txt=@ " .../text[@accessiblevalue='[0-9]*'] "
is this correct if not plz correct it.
rohitjain3333
 
Posts: 12
Joined: Tue Sep 20, 2011 8:12 am

Re: Problem in accessing the element

Postby Support Team » Wed Sep 21, 2011 2:41 pm

Hi,

your RanoreXPath holding the reg exp should look something like this:
/text[@accessiblevalue~'^[0-9]+\.?[0-9]*$']

  • ^ ... starts with
  • [0-9]+ ... a digit one or more times
  • \.? ... a "." zero or one times
  • [0-9]* ... a digit zero or more times
  • $ ... ends with

For more details about using regular expressions in RanoreXPath have a look at following chapter of our user guide:
http://www.ranorex.com/support/user-gui ... html#c3294

Regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Problem in accessing the element

Postby rohitjain3333 » Thu Sep 22, 2011 8:52 am

thanx a lot this solved my problem... :)
rohitjain3333
 
Posts: 12
Joined: Tue Sep 20, 2011 8:12 am


Return to General Questions

Who is online

Users browsing this forum: No registered users and 0 guests