WebPagetest Forums
selectValue equivalent on browsers other than IE - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: selectValue equivalent on browsers other than IE (/showthread.php?tid=13010)



selectValue equivalent on browsers other than IE - pganti - 06-04-2014 05:39 AM

I want to script selecting a value in the dropdown list. As per the doc

selectValue id=email label=foo@bar.com

would work. However how do I do the same for Chrome/FF?


RE: selectValue equivalent on browsers other than IE - pmeenan - 06-05-2014 12:26 AM

Use exec combined with plain old JS is probably your best bet. That way you can debug it locally in dev tools to make sure it works.

Something like:

exec document.getElementById("email").selectedIndex = 5


RE: selectValue equivalent on browsers other than IE - pganti - 06-05-2014 03:27 AM

(06-05-2014 12:26 AM)pmeenan Wrote:  Use exec combined with plain old JS is probably your best bet. That way you can debug it locally in dev tools to make sure it works.

Something like:

exec document.getElementById("email").selectedIndex = 5

Thank you for that pointer. That works! Appreciate your prompt response as always