Jump to content

"Input string was not in a correct format". Embedded IE Window


Go to solution Solved by GoogleDude,

Recommended Posts

Strange thing happening.

I have created an Embedded IE window in a simple GUI. The Embedded IE window loads a ASPX webform that I have set to auto fill with my login info. But when the form gets submitted using _IEAction($oSubmit, "click")  a dialog comes up titled "Message from webpage" saying "Input string was not in a correct format."

If I take the same form fill data but take it out of the embedded ie window and just use _iecreate it works just fine.

If I let the form fill in the embedded ie window but not submit the form and I manually click the submit button on the webpage I get the same error. If I retype any of the data feilds in the form with the same data and then click the submit button it submits the form just fine.  It seams to have something to do with the fact that the ie window is embedded in a gui or something.

I googled for the error and all I can find it a bunch of stuff talking about .NET and ASPX on the server and such.

the form in question is a login.aspx type form with 3 simple fields.

Anyone have any ideas?

Thanks,

GD

Link to post
Share on other sites

My crystal ball is in the repair shop, can you post your code until it is fixed?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to post
Share on other sites

#include <IE.au3>
#include <Inet.au3>
#include <Constants.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$ClientUsername = "myusername"
$ClientPassword = "mypassword"
$ClientCompanyName = "mycompanyname"

Opt("GUIOnEventMode", 1)
local $MyURL = _IECreateEmbedded()

$MainGUI = GUICreate("Client", 795, 610, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX,$WS_THICKFRAME,$WS_CLIPCHILDREN,$WS_EX_COMPOSITED ))
$ObjectIE = GUICtrlCreateObj($MyURL, 8, 8, 777, 561)
GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKLEFT)
GUICtrlCreateLabel("", 8, 580, 34, 17, $WS_CLIPSIBLINGS)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUISetOnEvent($GUI_EVENT_CLOSE, "CloseGUI")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "CloseGUI")
GUISetOnEvent($GUI_EVENT_RESTORE, "CloseGUI")
_IENavigate($MyURL, "http://my.server.com/login.aspx")
$ClientLogonForm = _IEFormGetObjByName($MyURL, "form1")
_IEFormReset($ClientLogonForm)
$o_username = _IEFormElementGetObjByName($ClientLogonForm, "txtUserName")
_IEFormElementSetValue($o_username, $ClientUsername)
$o_password = _IEFormElementGetObjByName($ClientLogonForm, "txtPassword")
_IEFormElementSetValue($o_password, $ClientPassword)
$o_companyname = _IEFormElementGetObjByName($ClientLogonForm, "txtCompany")
_IEFormElementSetValue($o_companyname, $ClientCompanyName)
$oSubmit = _IEGetObjByName($ClientLogonForm, "btnLogin")
_IEAction($oSubmit, "click")

GUISetState(@SW_SHOW)

_WinAPI_MoveWindow($MainGUI, 100, 100, 450, 350)

While 1
    Sleep(250) ; Idle loop
WEnd

Func CloseGUI()
    Select
        Case @GUI_CtrlId = $GUI_EVENT_CLOSE
           GUIDelete($MainGUI)

        Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE

        Case @GUI_CtrlId = $GUI_EVENT_RESTORE

    EndSelect
EndFunc

Edited by GoogleDude
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...