Hello,
With regards to the post below:
https://www.ranorex.com/forum/how-to-se ... t5773.html
I wanted to ask if there is any update on the newer versions of Ranorex.
I want to convert a string to a repoitem Object
Eg: Want to track the above element:
Voltage = 122.07 Volts
Now, everytime i am going to test the UI, the value of this voltage is going to change anywhere from 120 to 180.
For converting the repoitem to string, and then performing a substring operation (getting only the numerical part - 122.07), followed by double conversions and arithmetic operations is successful for checking the range in user code.
However, i want to introduce a mouse click event for this string item after performing all these operations in user code
Is there any way to convert string to a repo-item info for handling the mouse click event?
Ranorex Version: 7.2.0
Windows 7
Setting the string value to a repoitem Object Info
-
- Posts: 36
- Joined: Mon Jan 16, 2017 3:24 pm
Re: Setting the string value to a repoitem Object Info
Please post a Ranorex Snapshot (NOT a screenshot!) of the element in question. Without it there's not much we can do.
My suggestion would be to stop trying to do all that converting and use the label as the marker for the value, but again, without a snapshot it will be impossible to give you any meaningful help.
My suggestion would be to stop trying to do all that converting and use the label as the marker for the value, but again, without a snapshot it will be impossible to give you any meaningful help.
Shortcuts usually aren't...
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Setting the string value to a repoitem Object Info
Hello Manlitatke,
Based on your requirements, I am failing to see why you need to convert a string to a repoitem. You can use RegEx in your RanorexPath to select the correct object, for example: /*[innertext~'1([2-7][0-9]|[8][0]) Volts']. This RegEx pattern will only find the object if it is within the specified range (120-180), which means you can use a simple Validate > Exist action to validate it exists and is within the required range without any coding or extra steps. If you need to pull the exact value without the ' Volts', you can use a Get-Value > Innertext and trim " Volts" off the end (in code).
I hope this helps! With more information of your issue and a Ranorex Snapshot, we will be able to better assist you.
Cheers,
Ned
Based on your requirements, I am failing to see why you need to convert a string to a repoitem. You can use RegEx in your RanorexPath to select the correct object, for example: /*[innertext~'1([2-7][0-9]|[8][0]) Volts']. This RegEx pattern will only find the object if it is within the specified range (120-180), which means you can use a simple Validate > Exist action to validate it exists and is within the required range without any coding or extra steps. If you need to pull the exact value without the ' Volts', you can use a Get-Value > Innertext and trim " Volts" off the end (in code).
I hope this helps! With more information of your issue and a Ranorex Snapshot, we will be able to better assist you.
Cheers,
Ned
-
- Posts: 36
- Joined: Mon Jan 16, 2017 3:24 pm
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: Setting the string value to a repoitem Object Info
I don't really follow what you're trying to do, but have to taken a look at this approach?
Doug Vaughan