How to select second element from <LI> list?

selector

#1

How can i select the second element in the LI list ?

Below is the selector of my drop down box :

<html app=‘chrome.exe’ htmlwindowname=‘localess’ title=‘XYZ’ />
<webctrl parentid=‘DevddlEnquireEmployee_ddlEmployee_DropDown’ tag=‘LI’ aaname=‘10012 ~ Prashant Telang’ />


#2

@alhad_alsi
Refer this post

after extracting as a list take the second element and replace the aaname feild in selector with the second element of the list.

Regards,
Mahesh


#3

image

getting this error


#4

@alhad_alsi

refer the post , to extract the list. give the selectors of the combi box which you have to extract

Regards,
Mahesh


#5

The reference post is discussing about selecting elements from Select box whereas I have to select the elements from LI tag.
My structure is like

<UL>
<LI>1</LI>
<LI>2</LI>
<LI>3</LI>
<LI>4</LI>
</UL>

By using UI explorer when I get the LI elements it returned me in following way :
<html app=‘chrome.exe’ htmlwindowname=‘localess’ title='XYZ />
<webctrl idx=‘1’ parentid=‘DevddlEnquireEmployee_ddlEmployee_DropDown’ tag=‘LI’ />

and so on… under UI tag…
Now, I am looking to get the IDX property which I am not getting.


#6

Hi @alhad_alsi,

Instead of IDX you can goto aaname

in title value give as “*” and try it.
Find children Properties change the scope to FIND_DESCENDANTS

Regards,
Arivu :slight_smile:


#7

Hi… I did the same with hot key operation. While selecting items from Ul - LI I was having some weird issue. If I select 3rd element , the selector was selecting 2nd element. As the web application has restricted the users from inspecting the DOM elements , i was not able to analyse the components used. Thus I let the selector to select the second element . I expand the list again and select the second element from the list which is the 3rd element I was looking for. This was really a frustrating issue. Anyway,…thanks for your help. :slight_smile: