Just wondering, but do you really need to use a dictionary with uielement as the keys. It might make more sense to use the aaname instead as a string. Instead of doing dict(element), you could do dict(aaname) or dict(“Apple”) or dict(row(“Fruit”).ToString.Trim)
If you do use the uielement, though, you will need to identify the element in the keys that contains the aaname, which might be more technical.
For example
element = dict.Keys.Where(Function(e) e.GetType("aaname").Equals(row("Fruit").ToString.Trim) ).First
…or something like that apologies, it might have a mistake
Then, use that element as your key, like dict(element)
Another way, is if you already have an uielement from Find Element activity or other steps, then you can simply use that in both the dict, and filter the row using the aaname of that element to find the value that goes with the aaname.
However, like I said, I kind of think it might be simpler to use a string as the key rather than an uielement. Here is an example:
For each row In dt1
Assign dict(row("Fruit").ToString.Trim) = CDbl(row("Value").ToString)
Then, to use the element create a selector that uses the string for the aaname.
< aaname='"+row("Fruit").ToString.Trim+"' />
…or whatever the selector is, but you can use that string in the aaname attribute.
Hopefully, that makes sense.
If you show part of your workflow, I might be able to provide further advice.
Regards.