I’m developing a somewhat complex bot for my work section. This next hurdle of mine is trying to toggle a check box that isn’t exactly next to the variable text it needs to find and select. AssetID is the variable, the position on the page may change with every transaction processed. See screen shot below.
I get the “Anchor Base: Text was not found” error.
I’ve tried Find Element, and that gives me an error about the scope, selector, and something else isn’t working. I’m at standstill with this project. Any advice or direction is greatly appreciated.
Hi @Davin_Richardson
You should pick the number element, it should retrieve and attribute called aaname or innerText, you should create a dynamic element passing your variable based on one of the previous attributes
BTW: in the left side you should use a find element activity, pick the asset id and create the dynamic selector. In the right side use a click activity or check activity
Regards!
It is actually easier to create and maintain anchors in a single selector.
- Select the checkbox via the UiExplorer and then choose indicate anchor.
- Select the text as an achor.
- From the selected ui elements click the anchor and make this (sub) selector reliable and/or dynamic
- No do the same for the main selector.
The result will look something like this:
<html app='msedge.exe' />
<webctrl tag='TD' aaname='Mytext2' />
<nav up='1' />
<webctrl tag='INPUT' type='checkbox' />

line 1 is your window / parent selector
line 2 refers to the anchor, in this case the TD with text ‘Mytext2’
line 3 provides the hierarchy relation between the 2 elements
line 4 the actual checkbox, with a non specific selector.
Replace ‘MyText2’ with ‘{{YourVariable}}’ and it is dynamic.
That works! Thank you Jeroen_van_Loon
Next issue I’m having in this same project is basically the same but now its without the check box.
Need to click on DD1348-TRF, and use UIC - {variable} as anchor? Ui Explorer isn’t allowing me to select that info to change for the variable.
Should be possible using the same method. The hierarchy in the table might differ somewhat, resulting in different values for your "<nav up='x' />"
value and the selected controls might have different tags but that should be all.
Proboably something like this:
<html app='msedge.exe' />
<webctrl tag='TD' aaname='*{{yourVariable}}' />
<nav up='1' />
<webctrl tag='a' />
Note the * in the anchor selector to use as a wildcard for your Rpt level prefix.
Using the view source (in your browser) of your target web should give you some insight of the table’s structure (if it even is a table).
Nonetheless sometimes you get weird sites with wierd constructions where even anchoring is difficult.
A more sluggish method would be looping through the options, validating the table rows one by one untill you get a match. Then use the same tablerow identifier to click the link. But that would be a really desparate method. I recommend playing with the anchor method first.