Jump to content

Recommended Posts

_IEGetObjById and _IEGetObjByName functions use variable of an InternetExplorer.Application, Window or Frame object as reference to find any dom element.

Is it possible to use a dom element instead of InternetExplorer.Application, Window or Frame to find target dom element instead the dom element. This will help in finding elements using a parent child relationship where duplicate target dom elements exists on the HTML page.

Other automation tools like WebDriver do have this feature. It would be great to have something like this in AutoIt. I love the way AutoIt works!!!!! Especially the IE UDF. Cool stuff from DALE and other developers.

Ex - i would like to do something like this,

$oIE = _IEAttach("Title")

$oParentObject = _IEGetObjById($oIE, "Parent Widget or element Id which contains my target widget in its hierarchy below")

$oTargetObject = _IEGetObjById(oParentObject , "Id of widget i would like to find and do some action")

_IEAction($oTargetObject, "click")

This will help in situations where there are widgets with duplicate ids on the page....Ex - 2 Add buttons with same id on the same page.....One add button to add a CAR...another Add button to add a Vehicle. In this case i cannot click on the exact Add button i want just with the Add button id. i will need reference of their immediate parent object to uniquely identify them.

Link to comment
Share on other sites

In fact, _IEGetObjByName DOES work that way - it is an oversight in the docs not to specify it.

_IEGetObjByID does NOT work that way because it is illegal to have two objects with the same ID on a page. How the DOM handles such a situation is inconsistent and you may want to use other methods to select such objects (such as _IETagnameGetCollection).

Dale

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

Thanks for the calrification Dale! I used the _IETagnameGetCollection function finally!

One quick question. We often do something like oObject.title or oObject.id or oObject.name etc...... is there a way i can paremetrize the .id, .name, .title....

I would like to do something like

$sAttribValue = oObject.$sAttribute

OR

$sAttribValue = oObject & "." & $sAttribute

Here $sAttribute = id or name or title or innerHTML etc....

I tried both ways but didnt work.

Link to comment
Share on other sites

You can use Execute like this:

$oItems = Execute("$o_object.elements('" & $s_Name & "')")

Dale

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

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

×
×
  • Create New...