Jump to content
Sign in to follow this  
newcoding

unable to submit embedded IE form

Recommended Posts

newcoding

Internet Explorer Embedded window/dialog box

$oPopup = _IEAttach("Sign In Confirmation -- Webpage Dialog", "embedded")
$oForm = _IEGetObjById($oPopup, "signInConfirmationForm")
$oID = _IEFormElementGetObjByName($oForm, "idNumber")
_IEFormElementSetValue($oID, "123123")
$oEXP = _IEFormElementGetObjByName($oForm, "idExpirationDate")
_IEFormElementSetValue($oEXP, "06/12/2016")
$oSelect = _IEFormElementGetObjByName($oForm, "idType")
_IEFormElementOptionselect($oSelect, "State ID #", 1, "bytext"); needed so OK button appears/changes from grayed out
Sleep(2000)
;ABOVE CODE WORKS PERFECTLY, but I cannot submit the form
;Using _IEFormSubmit opens a new window and i lose all inputed data as well as login status
;-----------------------
;Make it click the button!!!!
;_IEImgGetCollection ;use next time?
;.FireEvent method use?
;$oElement.fireEvent("onmouseover")
$oPopup = _IEAttach("Sign In Confirmation -- Webpage Dialog", "embedded")
_IEImgClick($oPopup, "blahblahblah/images/bt-ok.gif"); as well as "blahblahblah/images/bt-d-ok.gif"
;and tried:
_IEImgClick($oPopup, "images/bt-ok.gif", "src"); and "images/bt-d-ok.gif"

code returns: _IEImgClick, $_IEStatus_NoMatch, I have the source code and exactly what the image is called, ID, name, src, etc, but still same error.

source code:

<input width="35" type="image" height="24" border="0" name="lastContinueEnable" src="blahblahblah/images/bt-ok.gif" alt="" onclick="submitValue();return false;" style="DISPLAY: none; VISIBILITY: hidden; CURSOR: hand" id="lastContinueEnable">
<input id="lastContinue" width="35" type="image" height="24" border="0" name="lastContinue" src="blahblahblah/images/bt-d-ok.gif" disabled="" style="VISIBILITY: visible">

I have also tried:

$oInput = _IEGetObjByName($oPopup, "lastContinueEnable"); and "lastcontinue" tried
_IEAction($oInput, "click")

returns same nomatch error

The OK image i need to click is greyed out until clicking outside form inputs and form has values. I used _IEFormElementOptionselect($oSelect, "State ID #", 1, "bytext") and it makes the button appear clickable.

Running this code, I do NOT get the /........../ok.gif image returned. I only get an image link for closing the window. So how is this image being hidden and how can i access it?

#include <IE.au3>
$oPopup = _IEAttach("Sign In Confirmation -- Webpage Dialog", "embedded")
Local $oImgs = _IEImgGetCollection($oPopup)
Local $iNumImg = @extended
MsgBox(0, "Img Info", "There are " & $iNumImg & " images on the page")
For $oImg In $oImgs
MsgBox(0, "Img Info", "src=" & $oImg.src)
Next

Please help me. Let me know if anything else is needed. I'm stuck and this is the last part I need to complete my script to automate part of my job.

Edited by newcoding

Share this post


Link to post
Share on other sites
newcoding

Hmm, can't edit my post. But I found a dirty way to make it work, not optimal as these commands may get intercepted by another window.

Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{ENTER}")

6 tabs and the OK image is selected and can be "clicked" with enter. A more elegant approach may be needed if i want to do anything else on the computer while this is running.

Share this post


Link to post
Share on other sites
Melba23

newcoding,

You do not get "Edit" permissions until you have made 5 posts. Be patient. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
newcoding

I have a solid workaround now. Using:

ControlSend("Sign In Confirmation -- Webpage Dialog", "","[CLASSNN:Internet Explorer_Server1]", "{TAB}" & "{TAB}" & "{TAB}" & "{TAB}" & "{TAB}" & "{TAB}" & "{ENTER}")

The keys are sent directly to the window. The window comes to forground, but its not too annoying.

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  

×