Jump to content

_IE functions


Recommended Posts

Hi,

I am trying to use the _IE functions.

I am able to use the _IECreate function which will load the html page which we have generated. 

But when I am trying to use_IEGetObjByName function the return value shows 0 which is an error.

Same with the result of _IEFormGetObjByName function. My script is only opening the html page. It is not performing any other  functions.

Also to mention I am including #include <IE.au3> header.

Could someone please help me with this?

 

Thanks.

 

Link to comment
Share on other sites

  • Moderators

Abiarch,

Welcome to the AutoIt forum.

But please pay attention to where you post - the "Dev Chat" section where you started this thread is not for general support questions.  I have moved it for you, but would ask you to be more careful in future.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Below is the code snippet I am talking about. I am new to autoIT. 

#include <IE.au3>
Local $Link = "D:\path\Example.html"
Local $oIE = _IECreate($Link)
Sleep(2000)
Local $oForm = _IEFormGetObjByName ($oIE, "test123") 
Sleep(2000)
Local $oSubmit = _IEGetObjByName($oForm, "submitExample")
_IEAction($oSubmit, "click")
_IELoadWait($oIE)

 

I tried printing the return value for _IEFormGetObjByName and _IEGetObjByName. It prints 0.

Link to comment
Share on other sites

 Hi,

Thanks Danp2 for your response. 

I tried getting value of @error. The value is 0. Which probably means no error.

Is anything missing in the code snippet I have posted below? I cant see any other operation while running the script other than opening of the html page.

Below is the code snippet I am talking about. I am new to autoIT. 

#include <IE.au3>
Local $Link = "D:\path\Example.html"
Local $oIE = _IECreate($Link)
Sleep(2000)
Local $oForm = _IEFormGetObjByName ($oIE, "test123") 
Sleep(2000)
Local $oSubmit = _IEGetObjByName($oForm, "submitExample")
_IEAction($oSubmit, "click")
_IELoadWait($oIE)

 

I tried printing the return value for _IEFormGetObjByName and _IEGetObjByName. It prints 0.

Below is the code snippet I am talking about. I am new to autoIT. 

#include <IE.au3>
Local $Link = "D:\path\Example.html"
Local $oIE = _IECreate($Link)
Sleep(2000)
Local $oForm = _IEFormGetObjByName ($oIE, "test123") 
Sleep(2000)
Local $oSubmit = _IEGetObjByName($oForm, "submitExample")
_IEAction($oSubmit, "click")
_IELoadWait($oIE)

 

I tried printing the return value for _IEFormGetObjByName and _IEGetObjByName. It prints 0.

Link to comment
Share on other sites

Below is the html script. 

<html>

<body>

<form name="test123" onSubmit="javascript:alert('ExampleFormSubmitted');" method="post">

<input name="submitExample" type="submit" value="Submit">

</form>
</body>
</html>

Link to comment
Share on other sites

I saved your html file and your script and tried it.  Since the HTML file is running locally, it was asking me to "Allow Blocked Content", which is what I think is throwing your script off.  I modified the script to the below and it works.  See if it works for you...

 

#include <IE.au3>
Local $Link = "D:\path\Example.html"
Local $oIE = _IECreate($Link)
_IELoadWait($oIE)
Sleep(5000)
Local $oForm = _IEFormGetObjByName ($oIE, "test123")
Sleep(2000)
Local $oSubmit = _IEGetObjByName($oForm, "submitExample")
_IEAction($oSubmit, "click")
_IELoadWait($oIE)

 

Edited by MuffinMan
Link to comment
Share on other sites

Hi,

I tried the same.

But it just gives me the attach html page. I have attached the screen shot. No action is performed after that. The mouse click isnt performed on submit button. 

And also I have disabled "allow blocked content" by going to IE settings. So I am not finding that tab anymore.

 

html_result_screenshot.png

Link to comment
Share on other sites

Can you show what errors you are getting from the ScITE window?  Have you tried turning on IIS and running this as a real webpage?  Or making sure you set that drive path up as a trusted zone in IE? Maybe try disabling virus scan for a few minutes??

This is what I get when I run your script:

 

ie_screen.jpg

Link to comment
Share on other sites

Good to know that its working for you as expected :) 

I am not getting any error in ScITE window. I tried adding my local html page to trusted site but it won't allow me as it is not an https page.

The issue is 

_IEFormGetObjByName is not able to return the form value.

Hence the error is 0. 

 

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...