Need Help with creating Dynamic Selectors

I just used the find children activity and used the same selectors code in the click activity after that, it still clicks on the old text when I run it the second time.

@Pema_Sherpa In find children activity get the last element and click it.

Regards,
Arivu

2 Likes

Hi @Pema_Sherpa,

Find children output → innumerable

Assume as Children

Get the last element Children.last

Using click event pass the element as Children.last

Regards,
Arivu

2 Likes

1234

The workflow has validation errors. Review and resolve them first.

System.Activities.InvalidWorkflowException: The workflow has validation errors. Review and resolve them first. —> System.Activities.InvalidWorkflowException: The following errors were encountered while processing the workflow tree:
‘DynamicActivity’: The private implementation of activity ‘1: DynamicActivity’ has the following validation error: The following overload groups are configured: Element, Selector. Only one overload group should have its arguments configured.
at System.Activities.Validation.ActivityValidationServices.ThrowIfViolationsExist(IList`1 validationErrors, ExceptionReason reasolve

@Pema_Sherpa, In click activity as arivu mentioned, pass children.last in element property

Regards,
Dominic :slight_smile:

2 Likes

In click activity change the properties change selector to children.last

Regards,
Arivu

2 Likes

@arivu96, as it is an Uielement you need to pass it in element not in selector

Regards,
Dominic :slight_smile:

2 Likes

Yes you are correct pass it into element property

Regards,
Arivu

2 Likes

Set the Scope property to “Find Descendents” .

Regards,
Arivu

2 Likes

@Pema_Sherpa
in find children activity use filtr as <webctrl tag='TR />
Untitled

Regards,
Arivu

2 Likes

this is new pema.

An error has occured

Source: System.Xml

Message: Unable to cast object of type ‘Newtonsoft.Json.Linq.JValue’ to type ‘System.String’.

Exception Type: InvalidCastException

it gives out his error

@sherpa24,
can you elaborate, in which activity are you getting the issue

Regards,
Arivu

1 Like

An error has occured

Source: System.Xml

Message: Unable to cast object of type ‘Newtonsoft.Json.Linq.JValue’ to type ‘System.String’.

Exception Type: InvalidCastException

System.InvalidCastException: Unable to cast object of type ‘Newtonsoft.Json.Linq.JValue’ to type ‘System.String’.
at System.Xml.XmlException…ctor(SerializationInfo info, StreamingContext context)
at Void .ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)(Object )
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializableItem(JToken token, Type type, JsonISerializableContract contract, JsonProperty member)
at Newtonsoft.Json.Serialization.JsonFormatterConverter.Convert(Object value, Type type)
at System.Runtime.Serialization.SerializationInfo.GetValue(String name, Type type)
at System.Exception…ctor(SerializationInfo info, StreamingContext context)
at Void .ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)(Object )
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateISerializable(JsonReader reader, JsonISerializableContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at UiPath.Shared.JsonParser.DeserializeObject[T](String jsonValue)
at UiPath.Models.UiPathDuplexProxy.<>c__DisplayClass21_0.b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

It is in find children activity.

Send screenshot or send me the xaml so that I try to resolve it

Regards,
Arivu

HI @sherpa24,

In Find Children Properties Filter after TR single quote is missing.

Regards,
Arivu

1 Like

now it says that the click activity has no elements :frowning: :frowning:
.

Hi @sherpa24,

i think you are selecting the wrong selector for Find children, select the whole table as selector
the selector will look like tag=‘TABLE’, use UiExplorer to get the exact selector.

Regards,
Arivu

1 Like

It is still giving me the same error. from the find children it is not returning any element.