SELECTOR FOR CLICK

Hey there !!! I have been stuck in a process … Where I need to click the audio button in my chatbot and i need only my new message’s audio button to be clicked … I tried some of the activity but it clicks the older one even if there is a new message. I attach my screenshot of my chatbot and my selector for that audio button. kindly help me to get through it.

I have compared every new message’s audio button’s selector . Only Idx value differs by 1 ,2,3 and so on

@ovi @loginerror

2 Likes

Hello,

You can use the activity “Find Children” and use the selector:

<html app='chrome.exe' title='DocBot' />
<webctrl id='frame' tag='IFRAME' />
<webctrl tag='TABLE' />
<webctrl tag='TD' />

The output from the activity will be all elements(messages sent). Use Children.count.toString as a dynamic index in the selector.

2 Likes

Thanks for your response sir !! @Obsev

What should i specify in Filter property of FindChildren sir

Nothing, just leave that empty. All you need to add is Selector and Output :slight_smile:

In the selector for the click you will use the Output as an dynamic index.
To this - Create a string variable and assign children.count.toString to it(children is the output from Find Children activity). And in the selector that you currently have for the Click activity you exchange idx=‘2’ with idx=’{{theStringVariableYouCreated}}’.

Sir, @Obsev

You haven’t set any output, and I forgot that you need to set filter as "<webctrl />"

1 Like

Yeah sorry for forgetting the filter…! Let me know if you get it to work or if I can help more :slight_smile:

@Obsev Sir

Sir i also checked that stringVar’s value by printing it . It actually returns 4 . but the Idx value what i clicked with click activity is 2 @Obsev sir

it should be idx=’{{stringVar}}’

1 Like

@Obsev yeah sir now it works fine, But its not giving the correct Idx value . i.e, Children value . If it returns correct it clicks the Microphone button and not clicking audio button sir

See attached file.

Go to AngryBot and write few messages and run the workflow, it will click the last response.
“AngryBot” doesn’t have that speaker icon so I cannot try it, but should work the same.

ChildElements.xaml (6.2 KB)

if previous file gave an dependency error please try this one

ChildElements.xaml (6.1 KB)

1 Like

@Obsev Sir

@Rakesh_Sampath

As @Obsev said before, try this :

1 - Find Children Activity, selector code :point_down:

<html app='chrome.exe' title='AngryBot' />
<webctrl id='frame' tag='IFRAME' />
<webctrl tag='TABLE' />
<webctrl tag='TD' />

Note * The output variable is “varChildren”

2 - Assign Activity, code :point_down:

ElementIndex = varChildren.Count.ToString

3 - Click Activity, selector code :point_down:

<html app='chrome.exe' title='AngryBot' />
<webctrl id='frame' tag='IFRAME' />
<webctrl idx='{{ElementIndex}}' parentid='result' tag='DIV' />

Let me know if it works :slight_smile:

I probably have newer package version. You can try this as well, I lowered the versions as much as I could :slight_smile:

ChildElements.xaml (5.6 KB)

Nope Buddy !!

This Happens ,Its not clicking the button …its clicking the feeling word

Yes but you just have to change the selector to click the icon, I just wanted to show the logic for index. Indicate the icon with the click activity and change the idx as in my example :slight_smile:

Yes sir, i have tried it

Is it possible for you to share that bot? Or if you know a public one which has that icon - please send and I’ll try to help.