Jump to content
Peaky

Noobie Question: Multiple Dropdown selection in the same form

Recommended Posts

Peaky

Hi All,

I'm new to AutoIt and scripting, just finished some video tutorial on Udemy and ready to jump start my first project. What's a better way to learn than actually doing it right?

So I'm trying to write a script so that it fills out two selections in the same form on a web page and could not get the second one to work.  The first selection works out great, but I could not tell what is wrong. 

 

Any help is greatly appreciated!!

TG

 

Global $DocTranslator = "https://www.onlinedoctranslator.com/translationform"

$oIE = _IECreate()
_IENavigate($oIE, $DocTranslator)
_IELoadWait($oIE, $DocTranslator)
$Translation = _IEGetObjById($oIE, "translation-form")
$TranslationFrom = _IETagNameGetCollection($Translation, "select", 0)
$TranslationFrom.focus
_IEFormElementOptionSelect($TranslationFrom, "English", 1, "byText")
$TranslationTo = _IETagNameGetCollection($Translation, "select-to", 0)
$TranslationTo.focus
_IEFormElementOptionSelect($TranslationTo, "Dutch", 1, "byText")

Share this post


Link to post
Share on other sites
TheDcoder

Try this and spot the difference ;)

#include <IE.au3>

Global $DocTranslator = "https://www.onlinedoctranslator.com/translationform"

$oIE = _IECreate()
_IENavigate($oIE, $DocTranslator)
_IELoadWait($oIE, $DocTranslator)
$Translation = _IEFormGetObjByName($oIE, "translation-form")
$TranslationFrom = _IEFormElementGetObjByName($Translation, "from")
_IEFormElementOptionSelect($TranslationFrom, "English", 1, "byText")
$TranslationTo = _IEFormElementGetObjByName($Translation, "to")
_IEFormElementOptionSelect($TranslationTo, "Dutch", 1, "byText")

 


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
Peaky

works like a charm!! thank you so much!!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×