So i am trying to automate a scenario where in I need to select a checkbox next to a desired text which changes with every run.
On trying to automate,the selector for that radio button is showing “UIElement is no longer Valid” error.So basically i cant find out selector for that radio button through normal means.
So i tried with Anchor base,as shown below.The issue in this case is that the click doesnt work at all.No exceptions are thrown either
The last thing i tried was to record Image based automation.In this case the click image was recorded but it used offset information and so i cant use this with respect to my desired text as this always was clicking at a particular point and not with respect to anything.
So I need your suggestions on how to make this work.I need to click a radio button with respect to my desired text.
@Vidya_Srinivasan If Clicking on the Desired text will let you Check it’s Checkbox, then use a Click Activity on the Desired Text instead of the Checkbox. If it Works, we’ll need to Check it’s Selectors and modify it accordingly using UiExplorer.
@Vidya_Srinivasan Are you sure there exists no Selector for the Checkbox, Have your tried to Indicate the element using UiExplorer, Also there is a Check Activity , Have you tried it ?
What is the version of your Studio and the UIAutomation activity package?
Quick fix is sometimes to simply update the UIAutomation package to the latest version (as this is the package that is responsible for the UI interactions within Studio).
Also, does the line get selected on a mouse click? I noticed that you have the ability to grab the selector for the text. It might be possible to still use that to i.e. to first click the text and then Send Hotkey SPACE to select the checkbox. This is tricky though, because best practice would be to then check if the field was correctly selected (and for that you would want a selector)
Another workaround would be to set the Click activity on the text, but provide it with a CursorPosition offset to to offset the click to the left to actually click on the checkbox.
Thank you for those pointers.It really helped.
I used image based click for that checkbox.And then it was showing that selector on basis of row number.
I extracted the row number of that desired text and used it as a dynamic variable in my selector.That helped get over this issue.