Select Value from Drop Down List Box

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
techimac
Posts: 293
Joined: Fri Feb 20, 2015 9:27 pm

Select Value from Drop Down List Box

Post by techimac » Mon May 23, 2016 6:12 am

https://www.cbussuper.com.au/tools-reso ... /about-you

I am not able to select values from 'Frequency' Drop Down List Box.

Recorded by EVENT MODE

EVENT TYPE=CLICK SELECTOR="#select2-salaryFreq-69-container" BUTTON=0
EVENT TYPE=MOUSEDOWN SELECTOR="#select2-salaryFreq-69-result-wxtp-1" BUTTON=0
EVENT TYPE=MOUSEUP POINT="(589,975)"

Firefox Browser
IrishMacro
Posts: 135
Joined: Wed Nov 03, 2010 12:27 pm

Re: Select Value from Drop Down List Box

Post by IrishMacro » Mon May 23, 2016 9:27 am

It's because id keeps changing names.

reload page and notice how it keeps changing names:
select2-salaryFreq-lt-container
select2-salaryFreq-nu-container
select2-salaryFreq-xe-container
Firefox free plugin, last version
Win7
techimac
Posts: 293
Joined: Fri Feb 20, 2015 9:27 pm

Re: Select Value from Drop Down List Box

Post by techimac » Mon May 23, 2016 9:35 am

not about names changing.
you record with EVENT mode,
run macro without loading url and change drop down value to other than recorded.
see, it won't select.
chivracq
Posts: 8761
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Select Value from Drop Down List Box

Post by chivracq » Mon May 23, 2016 12:55 pm

Had a quick look at this Site, and hum..., works fine for me, I'm able to select any Value from the 'Frequency' DDLB...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 293
Joined: Fri Feb 20, 2015 9:27 pm

Re: Select Value from Drop Down List Box

Post by techimac » Mon May 23, 2016 4:00 pm

can you share your code?
chivracq
Posts: 8761
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Select Value from Drop Down List Box

Post by chivracq » Mon May 23, 2016 4:36 pm

techimac wrote:can you share your code?
Hum..., if you improve the Quality of your last 2 Threads by mentioning your FCI to comply with the Forum Rules for Required Info to include for every New Thread..., read my Sig..., I shouldn't have to ask, you are not a Newbie anymore on this Forum... :roll:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 8761
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Select Value from Drop Down List Box

Post by chivracq » Mon May 23, 2016 10:14 pm

Hum, @techimac, I notice you checked the Forum less than 10 min after my last Reply but didn't comply with my Request to mention your FCI (which would take less than 1 min for 2 Threads), so I guess you are not interested by my Help..., but @IrishMacro who's already on the Thread will probably be able to help you as well, he's sneaky-good as well, and I said that I only had a VERY quick look at your Site, so there is no Sorcery in "my Working Script", you even mentioned "the Solution" in your previous Thread..., even if I think I'm probably the most knowledgeable (Advanced) User about the EVENT Mode on the Forum... (more than TechSup even, I would think, but I don't want to sound (too...! :oops: ) arrogant..., I might be wrong, but I've hardly ever seen TechSup posting about Solutions using the EVENT Mode, and I've been complaining for about 3 years about the Wiki being very poor...)

But OK, never mind...! 8)
(Dunno if you play Chess, but getting a Chess-Puzzle with "Chess-mate in 7 Moves" is easier to solve than playing a Game and thinking that "maybe" there is a Winning-Situation..., so you already know there is a Solution to your QT, hum, I think I had 3 working Scripts actually in the 2 min (hum..., OK maybe 5 min...!) I spent on your Site...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 293
Joined: Fri Feb 20, 2015 9:27 pm

Re: Select Value from Drop Down List Box

Post by techimac » Tue May 24, 2016 5:03 am

I don't have any preference whom I will take help.
This is virtual place and I don't know anyone in person.

VERSION BUILD=8970419
Firefox 46.0.1
Windows 8.1
chivracq
Posts: 8761
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Select Value from Drop Down List Box

Post by chivracq » Tue May 24, 2016 5:58 am

techimac wrote:I don't have any preference whom I will take help.
This is virtual place and I don't know anyone in person.

Code: Select all

VERSION BUILD=8970419
Firefox 46.0.1
Windows 8.1
Yep, perfect for this one but... "Last 2 Threads" I said..., I'm a bit tired of asking... :roll:
(And I don't even check the ones before, I normally only help Users using the Forum a bit correctly in all their Threads, but OK, you've got some "Positive" Credit for already answering many Threads and helping other Users but still, you should show the "good" Example when asking Qt's yourself...)

(I'm going to sleep very soon, so unless you mention your FCI in your 'gumtree' Thread as well a bit quick, (and in Future Threads as well, I won't ask again...), you'll have to wait a few more hours otherwise...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 8761
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Select Value from Drop Down List Box

Post by chivracq » Tue May 24, 2016 6:41 am

Update seen on the 'gumtree' Thread...

Script I used...:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'URL GOTO=https://www.cbussuper.com.au/tools-resources/calculators/retirement-income-estimate-calculator/about-you

'EVENT TYPE=CLICK SE:LECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(5)>DIV:nth-of-type(2)>DIV>LABEL" BUTTON=0
'EVENT TYPE=CLICK SELECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(5)>DIV:nth-of-type(2)>DIV>SPAN>SPAN>SPAN>SPAN:nth-of-type(2)" BUTTON=0

'EVENT TYPE=CLICK SELECTOR="#select2-salaryFreq-*-container" BUTTON=0
'EVENT TYPE=CLICK SELECTOR="#select2-salaryFreq-*-result-wxtp-1" BUTTON=0

'PAUSE
'EVENT TYPE=MOUSEDOWN SELECTOR="#select2-salaryFreq-tk-result-k4z2-26" BUTTON=0
'EVENT TYPE=MOUSEUP POINT="(592,894)"

'EVENT TYPE=CLICK SELECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(5)>DIV:nth-of-type(2)>DIV>LABEL" BUTTON=0
'PAUSE
EVENT TYPE=CLICK SELECTOR="#select2-salaryFreq-tk-container" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(5)>DIV:nth-of-type(2)>DIV>SPAN>SPAN>SPAN" KEYS="[40,40,40,13]"
(Tested (very quickly) on iMacros for FF v8.8.2, Pale Moon v26.1.1 (=FF43), Win10-x64.)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
techimac
Posts: 293
Joined: Fri Feb 20, 2015 9:27 pm

Re: Select Value from Drop Down List Box

Post by techimac » Tue May 24, 2016 7:11 am

Thanks

what steps you did actually?
techimac
Posts: 293
Joined: Fri Feb 20, 2015 9:27 pm

Re: Select Value from Drop Down List Box

Post by techimac » Tue May 24, 2016 7:18 am

EVENT TYPE=CLICK SELECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(5)>DIV:nth-of-type(2)>DIV>SPAN>SPAN>SPAN>SPAN:nth-of-type(2)" BUTTON=0

EVENTS TYPE=KEYPRESS SELECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(5)>DIV:nth-of-type(2)>DIV>SPAN>SPAN>SPAN" KEYS="[40,40,40,13]"


this is even better since element names changes.
techimac
Posts: 293
Joined: Fri Feb 20, 2015 9:27 pm

Re: Select Value from Drop Down List Box

Post by techimac » Tue May 24, 2016 7:26 am

if you go to calculations (3rd step) I need same thing again but can't do it.

EVENT TYPE=CLICK SELECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>SPAN>SPAN>SPAN>SPAN:nth-of-type(2)" BUTTON=0

This shows options but don't know how to select.

Keys part I understand: down down down enter
techimac
Posts: 293
Joined: Fri Feb 20, 2015 9:27 pm

Re: Select Value from Drop Down List Box

Post by techimac » Tue May 24, 2016 8:02 am

Thank you Sir.
didn't knew there are 2 different modes
EVENT & EVENTS

just noticed in your code.

I have code for second 'yearly as well.

EVENT TYPE=CLICK SELECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>SPAN>SPAN>SPAN>SPAN:nth-of-type(2)" BUTTON=0
PAUSE
EVENTS TYPE=KEYPRESS SELECTOR="#calculator>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>SPAN>SPAN>SPAN>SPAN:nth-of-type(2)" KEYS="[40,40,40,13]"
chivracq
Posts: 8761
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Select Value from Drop Down List Box

Post by chivracq » Tue May 24, 2016 9:44 pm

OK, looks like you are settled, good-good..., the 'KEYPRESS' Statement with the Arrow + Enter worked fine indeed for me (and you could even compute it dynamically using 'EVAL()'), I left all the things I tried quickly, the first Block was already/nearly working but I didn't investigate it very deep...

About 'EVENT'/EVENTS', we had some Thread recently about that and I think it doesn't really make a Difference, iMacros adds automatically the 'S' for several 'KEYPRESS'/'KEY' recorded Actions, but it doesn't really matter at Replay Time...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply