Sign in to follow this  
Followers 0
madhu

Get a document reference

10 posts in this topic

Hi i am new to this.We have software for automation right now with the script i able to login into home page of it now i have to click a image of the page so i am not able to get the reference of the page please help me. i have used IE management for the scripting.Below is the script:

#include <IE.au3>

$oIE = _IECreate ("url")

$o_form = _IEFormGetObjByName ($oIE, "name")

$o_Username = _IEFormElementGetObjByName ($o_form, "TextBox1")

$o_password = _IEFormElementGetObjByName ($o_form, "TextBox2")

$o_Login = _IEFormElementGetObjByName ($o_form, "Button1")

$username = "Username"

$password = "passwd"

_IEFormElementSetValue ($o_Username, $username)

_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_Login, "click")

$oDoc = _IEDocGetObj (objref) here is the problem

_IEFormImageClick($oDoc, "mage path")

Share this post


Link to post
Share on other sites



Could you be more specific? If you want to click on an image use the "_IEImgClick()" function, the reference of the page is already available in your "$oIE" variable

Share this post


Link to post
Share on other sites

Could you be more specific? If you want to click on an image use the "_IEImgClick()" function, the reference of the page is already available in your "$oIE" variable

Thanks for ur reply. $oIE is reference for login page now i am in home page and i want a ref for that.In the code i have already used the ref $oIE variable.I will tell an example just to understand with the use of script i have logined into yahoomail now i want clik inbox so how to get the script to click inbox.

Share this post


Link to post
Share on other sites

Ok, "$oIE" doesnt references the login page, it references the IE Object so after you clicked the image use a "_IELoadWait($oIE)" and you will be able to manipulate the home page

Share this post


Link to post
Share on other sites

Ok, "$oIE" doesnt references the login page, it references the IE Object so after you clicked the image use a "_IELoadWait($oIE)" and you will be able to manipulate the home page

_IEFormImageClick ($oIE, "Image path", "src")

_IELoadWait($oIE)

as of u above is the script but not working.

Share this post


Link to post
Share on other sites

what is the purpose of

$oDoc = _IEDocGetObj (objref) here is the problem
_IEFormImageClick($oDoc, "mage path")

???

To log in better use

_IEFormSubmit($oForm) instead of your last three lines

Share this post


Link to post
Share on other sites

i am able to login but not able to click on image.I will tell u so that u can catch my problem for example i logged into yahoomail now i have to click on a add image, so how to do the script for to click on the image.

Share this post


Link to post
Share on other sites

#include <IE.au3>

$oIE = _IECreate ("www.Yahoomail.com")

$o_form = _IEFormGetObjByName ($oIE, "login_form")

$o_Username = _IEFormElementGetObjByName ($o_form, "login")

$o_password = _IEFormElementGetObjByName ($o_form, "passwd")

$o_Login = _IEFormElementGetObjByName ($o_form, ".save")

$username = "type username"

$password = "passwd"

_IEFormElementSetValue ($o_Username, $username)

_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_Login, "click")

_IEImgClick ($oLi, "http://us.i1.yimg.com/us.yimg.com/i/nt/ic/ut/bsc/nwmail16_1.gif", "src")(here is the problem)

_IELoadWait($oIE)

If u dont mind try this and get me a script for clicking my inbox.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

As JavaCupiX pointed out, $oIE is a reference to the Internet Explorer Automation object, not to the specific embedded document object. Most of the _IE functions start with this automation object and then automatically reference the _current_ document object contained within. This way you can get the $oIE object reference once and not have to worry about refreshing it each time the document changes or reloads as you would it you were coding this yourself.

So, put $oIE where you have $oLi and you should be set.

Also, please insure you run your code from inside SciTe (use Tools -> Go) as IE.au3 writes many helpful diagnostic messages to the console.

Dale

Edit: typo

Edited by DaleHohm

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

Share this post


Link to post
Share on other sites

And making a second post with exactly the same problem won't get you getting it faster...

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
Sign in to follow this  
Followers 0