Jump to content

Using multiple combox in IE


Ram
 Share

Recommended Posts

Hi,

I have a page that has multiple combo box and text box. Now I also have a excel file that has the details that needs to be selected and entered to the combo box and text box respectively. I am able to enter data to the text box but i don't know how to go about selecting the combo box according to the data in the excel file...

Here is an eg:

Data for combox in excel file:

England

India

USA

USSR

The same is there in the webpage. post-19232-1187703867_thumb.jpg

Now I want select the above to reflect in the webpage. How do I go about doing this?

This is what I tried:

#include <ie.au3>
$oIE = _IECreate("http://www.leoastro.com/mat_frm.htm")
$oForm = _IEFormGetObjByName($oIE, "matching")
$oSelect = _IEFormElementGetObjByName ($oForm, "bcountry")
_IEFormElementOptionselect($oSelect, "Australia", 1, "byText")

but it gave me the below error:

--> IE.au3 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch

--> IE.au3 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType

--> IE.au3 Error from function _IEFormElementOptionselect, $_IEStatus_InvalidDataType

Can you tell me what is wrong in my code? I have attached the source file too?

Awaiting your response!

Thanks!

Edited by Ram
Link to comment
Share on other sites

There is a Frameset on that page. You'll need to use _IEFrame* functions to drill to the correct frame first.

Dale

P.S. Regarding _IEFormElementOptionselect -- please execute the examples in the helpfile for this function -- one of the three examples there will match your scenario.

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

There is a Frameset on that page. You'll need to use _IEFrame* functions to drill to the correct frame first.

Dale

P.S. Regarding _IEFormElementOptionselect -- please execute the examples in the helpfile for this function -- one of the three examples there will match your scenario.

I tried _IEFormElementOptionselect .. but gave out error I have also pasted the error too. I think you posted this message when I was editting the topic.

Regarding Frameset I did get the right page which is 'matching'.. but no luck?

Link to comment
Share on other sites

I tried _IEFormElementOptionselect .. but gave out error I have also pasted the error too. I think you posted this message when I was editting the topic.

Regarding Frameset I did get the right page which is 'matching'.. but no luck?

Wooo I got it right.. As you said the problem was in the frameset. I actually didn't declare the frameset and hence was not able to get the data selection correctly.. Now it works...!!

Thanks Dale for the help!!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...