Peaky

Noobie Question: Multiple Dropdown selection in the same form

3 posts in this topic

#1 ·  Posted

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



#2 ·  Posted

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

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

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

Share this post


Link to post
Share on other sites

#3 ·  Posted

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