Item selecting from the list

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Maxnic
Posts: 1
Joined: Mon Mar 20, 2023 9:39 am

Item selecting from the list

Post by Maxnic » Mon Mar 20, 2023 10:24 am

Hello,
I need help selecting from list. Following is the list source from the page:

Code: Select all

<ul class="chzn-results">
<li id="id0" class="active-result result-selected" style=""><Select One></li>
<li id="id1" class="active-result" style="">Accounts</li>
<li id="id2" class="active-result" style="">All Units</li>
<li id="id3" class="active-result" style="">Cafeteria</li>
</ul>
The selection works only if I use the ID attribute. But doesn't work when I use the displayed text
This works:

Code: Select all

EVENT TYPE=CLICK SELECTOR="#id1" BUTTON=0
But following doesn't work:

Code: Select all

TAG POS=1 TYPE=LI ATTR=* CONTENT=$Accounts
EVENT TYPE=CLICK SELECTOR="#chzn-results>UL>li:contains('Accounts')" BUTTON=0
I've no idea why it doesn't select the item from the list.
The only option right now is the keep a dictionary of list id and text and resolve the values when they are passed from the excel data sheet.
Any help is appreciated.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Item selecting from the list

Post by chivracq » Mon Mar 20, 2023 2:52 pm

Maxnic wrote:
Mon Mar 20, 2023 10:24 am
Hello,
I need help selecting from list. Following is the list source from the page:

Code: Select all

<ul class="chzn-results">
<li id="id0" class="active-result result-selected" style=""><Select One></li>
<li id="id1" class="active-result" style="">Accounts</li>
<li id="id2" class="active-result" style="">All Units</li>
<li id="id3" class="active-result" style="">Cafeteria</li>
</ul>
The selection works only if I use the ID attribute. But doesn't work when I use the displayed text
This works:

Code: Select all

EVENT TYPE=CLICK SELECTOR="#id1" BUTTON=0
But following doesn't work:

Code: Select all

TAG POS=1 TYPE=LI ATTR=* CONTENT=$Accounts
EVENT TYPE=CLICK SELECTOR="#chzn-results>UL>li:contains('Accounts')" BUTTON=0
I've no idea why it doesn't select the item from the list.
The only option right now is the keep a dictionary of list id and text and resolve the values when they are passed from the excel data sheet.
Any help is appreciated.

CIM...! :mrgreen: (Read my Sig..., and the Forum Rules... :idea: )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply