I want to move the mouse cursor to a particular text position in Ranorex Text control.
Type of my control is Ranorex Text-
When a automated class is created the mouse cursor should go to any text line which is inside the class.
Get position of substring in Windows in Ranorex.Text
-
- Posts: 2
- Joined: Tue Nov 03, 2020 5:29 am
Get position of substring in Windows in Ranorex.Text
- Attachments
-
- RanorexTextfile.PNG (22.71 KiB) Viewed 163 times
Re: Get position of substring in Windows in Ranorex.Text
Hi,
It should be relative easy, to get a position (index) of substring in a string, using IndexOf method:
https://www.dotnetperls.com/indexof
As for setting cursor to given position of the substring, well, this will be completely different story. And I'm afraid, I don't have any sample for this. I think that you will somehow get the x/y screen position of required substring and then move the mouse to that position and finally click there to set the cursor at given place. I think it's impossible to provide better steps, or even sample code, without seeing the app under test or demo app, featuring text input in question.
It should be relative easy, to get a position (index) of substring in a string, using IndexOf method:
https://www.dotnetperls.com/indexof
As for setting cursor to given position of the substring, well, this will be completely different story. And I'm afraid, I don't have any sample for this. I think that you will somehow get the x/y screen position of required substring and then move the mouse to that position and finally click there to set the cursor at given place. I think it's impossible to provide better steps, or even sample code, without seeing the app under test or demo app, featuring text input in question.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration