How to select first element in array element HTML?

I want to select first item in list item HTML with dynamic array . I attach picture below . Any help me . Thanks !

Screen Shot 2022-02-18 at 14.17.03

1 Like

Hey @Anh_Nguyen

<webctrl tag='SELECT' />
<webctrl tag='OPTION' idx='1' />

The above is the sample. Please do the same for your scenario.

The main thing in the above statement is idx=‘1’

The selector may vary in your case

Hope this helps

Thanks
#nK

Firstly , Thanks for your reply
But How can I use it ? , Where can I put it ? , What activity can I use ? ex : (click , select , or any … ?) .
One time , I see it in UIExplorer but I don’t understand much . Can you explain clearly ? . Thanks

But I check in DOM HTML , I see that they use tag

1 Like

Sorry yes you need to change the tag.

That’s why I just mentioned it’s a sample

You can use it in click activity. As I think you want to click it.

Please indicate that element in the Ui-Explorer and just show us please to verify and frame it.

Thanks
#nK

1 Like

Sorry for asking a lot . But I tried to change tag like this but It doesn’t work . Please help me to check picture below . another way to do this ? . Thanks


1 Like

Hey @Anh_Nguyen

From your validated selector (First image), Just change the tag value from A to LI

Remove the aaname attribute and parent id.

Add idx='1' as an attribute

That should help

Thanks
#nK

1 Like

Hey @Anh_Nguyen !! Use “Find Childrens” activity to get all tag li itens, then select the first one from your IEnumerable variable!

For example in screen shot, below is selector found after clicking on indicate element.
Than just untick the css-selector, until the div index appears.

This will click on the first index available on the web page.

untick

image

image

Hi , I tried to do uncheck aaname and parentid , and add idx=‘1’ . But It doesn’t work too Because I see that It clickes another place on screen , not item what I need. Idk why ? . After Indicate element in clicking activity , I’m using Selector Editor to edit xml tag . Please check pic. Thanks a lot

1 Like

Hi bro , when I use Indicate Element in UI Explorer , Css selector automatically uncheck . What I need right now , I can select item with dynamic content . You can check my step from pic

Hi bro , I’m using Find Children activity to get all item . but I’m stucking at indicate on screen because I can’t get list item by selecting whole list item like picture below . Please help me check it . Thanks !

Hey @Anh_Nguyen

Do me a small favour please?

Could you please show the selector for the above image which you posted - where the element is highlighted ?

Thanks
#nK

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.