I’m grabbing the text from each cell of the first row of an HTML table, and storing them in a Dictionary (of string, object). So a Get Text with output of ItemDict(“Item ID”) gets the Item ID from the first column of the table. Another Get Text with output of ItemDict(“Customer”) gets the customer name from the second column of the table. Etc.
One of the columns has a link in it (tag = A). I want to get this as a UiElement. I used Find Element and set its output to ItemDict(“Claim Link UiElement”) and it works fine. On looping through the ItemDict keys it even reports that ItemDict(“Claim Link UiElement”).ToString is a UiElement.
But when I try to use ItemDict(“Claim Link UiElement”) as the target of a Click activity, I get an error about not supporting conversion from Object to UiElement. So far I got around this by setting up a UiElement variable outside the Dictionary, and storing the UiElement in there. This isn’t ideal, though, as there should be a way to store the UiElement in the Dictionary as an object and get it back out as a UiElement, I just haven’t found out how.
If it matters, the point to using a Dictionary here is to store everything in a single variable that I can pass as a single item to other things, as this is a custom activity I’m writing that will be used within other automations. Those automations should be able to get the Dictionary as an output from the custom activity and then reference the keys in the Dictionary, including being able to click the link UiElement.