FF Browser Add-on - Issues with dropdowns

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
mccarthy995
Posts: 10
Joined: Fri Aug 03, 2018 4:27 pm

FF Browser Add-on - Issues with dropdowns

Post by mccarthy995 » Tue Jan 24, 2023 2:16 pm

Hi, first of all love this application, I have a personal licence but today I'm not on that machine and have a different use case.

VERSION BUILD=10101485
FF Version 109.0 (64-bit)
Windows 10

I know what the issue is
, Its just fixing it or getting a work around. There's 2 dropdowns on a webpage, one dropdown can be populated no issue with Imacros, but the other doesnt. The second dropdown populates I assume via JS based on the selection of the first dropdowns entry, Other wise if the first one is empty, the second one has one [emtpy] string entry.

Code: Select all

'Populate first dropdown no issue
TAG POS=1 TYPE=SELECT FORM=ID:incident.do ATTR=ID:incident.u_closure_category CONTENT=%Admin
'Tried to populate this with a string, ended up just using numbers
TAG POS=1 TYPE=SELECT FORM=ID:incident.do ATTR=ID:incident.u_closure_subcategory CONTENT=2

Error:
RuntimeError: Entry with index 2 not available [Box has 1 entries], line: 19

The above error makes sense as at the time the page loads, there is no populated dropdown untill the script is ran and it populates the first one, when the script populates though my script isnt smart enough to 'refresh' or understand that there is now data in there to be selected,

Any ideas?
Thanks,
Tom
chivracq
Posts: 10238
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: FF Browser Add-on - Issues with dropdowns

Post by chivracq » Tue Jan 24, 2023 2:50 pm

mccarthy995 wrote:
Tue Jan 24, 2023 2:16 pm
Hi, first of all love this application, I have a personal licence but today I'm not on that machine and have a different use case.

Code: Select all

VERSION BUILD=10101485 'PE'
FF Version 109.0 (64-bit)
Windows 10

I know what the issue is
, Its just fixing it or getting a work around. There's 2 dropdowns on a webpage, one dropdown can be populated no issue with Imacros, but the other doesnt. The second dropdown populates I assume via JS based on the selection of the first dropdowns entry, Other wise if the first one is empty, the second one has one [emtpy] string entry.

Code: Select all

'Populate first dropdown no issue
TAG POS=1 TYPE=SELECT FORM=ID:incident.do ATTR=ID:incident.u_closure_category CONTENT=%Admin
'Tried to populate this with a string, ended up just using numbers
TAG POS=1 TYPE=SELECT FORM=ID:incident.do ATTR=ID:incident.u_closure_subcategory CONTENT=2

Error:
RuntimeError: Entry with index 2 not available [Box has 1 entries], line: 19

The above error makes sense as at the time the page loads, there is no populated dropdown untill the script is ran and it populates the first one, when the script populates though my script isnt smart enough to 'refresh' or understand that there is now data in there to be selected,

Any ideas?
Thanks,
Tom

Yep, Timing Issue very probably, the (2nd) DDLB is already on the Page (and iMacros finds it at the 1st Attempt), but it has not been populated yet, => so you need to allow "a bit of time" before trying to select from that 2nd DDLB, => with a mini-`WAIT` Statement for example: :idea:

Code: Select all

'Populate first dropdown no issue
TAG POS=1 TYPE=SELECT FORM=ID:incident.do ATTR=ID:incident.u_closure_category CONTENT=%Admin

'Tried to populate this with a string, ended up just using numbers
WAIT SECONDS=0.5
TAG POS=1 TYPE=SELECT FORM=ID:incident.do ATTR=ID:incident.u_closure_subcategory CONTENT=2
But hum..., your "CONTENT=2" is not correct, you need to use '$'/'%'/'#' to select from a DDLB (Name/Value/Index)... :!:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
mccarthy995
Posts: 10
Joined: Fri Aug 03, 2018 4:27 pm

Re: FF Browser Add-on - Issues with dropdowns

Post by mccarthy995 » Mon Jan 30, 2023 12:14 pm

Chivracq the GOAT!

I remember asking for help years ago and you sorted me out, Nice to still see your username.

Thanks with this, I'll just go back to specifying text now since I was using numbers (incorrectly) to debug.

Kind regards
Tom
Post Reply