Get Children Returns 'Selector is not valid' despite using element target

I have a UI Element and I want to find one of its descendants based on a specific class name. To do this, I am using the ‘find children’ activity, and as I already have the parent element, I am using the ‘target.element’ field, and simply passing in the variable I have for this element. However, leaving the ‘target.selector’ field blank results in a ‘selector is not valid’ error from this activity.

I have tried adding a string to the ‘target.selector’ field, but then I get a warning that I cannot have both the ‘target.selector’ field and the ‘target.element’ fields filled out at the same time.

What am I doing wrong?
Is there a better way to do this as I am only returning one element?

@James_Hall
welcome to the forum

as mentioned we use the target.element or target.selector but not both on the same time.

As far you hvae already an UiPath.Element you can try following:

target.Selector = YourUiElementVar.Selector.ToString
target.Element = let it blank
configure the filter selector
configure the Find Scope

1 Like

Hey thanks for the fast reply, your solution works correctly so thanks!

However, I found that the problem with my original method wasn’t how I was inputting the target, it was that I hadn’t put my class name in quotes :expressionless: :expressionless: :expressionless:

perfect, so let’s close the topic by: