I don’t think this can be done. Could you expand on the use case? For example, when you say “position at runttime”, do you mean position in existing text?
@wreed So I have text field, which is called as EditText field in mobile. And I am looking for mechanism to get current cursor position in that EditText box.
Basically my test case is to check if cursor position remains intact wherever user leaves it before leaving the page. if I switch to some different pages in app and return back to this page, cursor should maintain its position as earlier in this EditText…
Even so, that won’t necessarily get you where you want to go. It can put you on a point, which is not the cursor position you asked for. I certainly wouldn’t discourage you from trying, but you may end up with a brittle test that is unreliable.