Jump to content

How to get the form object in web page.i.e each webpage has different tabs.


rodex
 Share

Recommended Posts

I'm not calling directly . i assume It was called by _IEFormSubmit ($TsecCon_Form,1)

please refer the attached SCITE console log..

------------------------------

0001: 0-0: #RequireAdmin

0002: 0-0: #Region ;**** Directives created by AutoIt3Wrapper_GUI ****

0003: 0-0: #AutoIt3Wrapper_UseAnsi=y

0004: 0-0: #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

0005: 0-0: #AutoIt3Wrapper_run_debug_mode=Y

0006: 0-0: #include <IE.au3>

0008: 0-0: _IEErrorHandlerRegister ("MyErrFunc")

0009: 0-0: $oIE = _IECreate("http://135.15.40.89:4444/vnmWeb",0,1,1,0)

0011: 0-0: sleep(500)

0012: 0-0: sleep(500)

0013: 0-0: $TsecCon_Form = _IEFormGetObjByName ($oIE, "LOGIN_FORM")

0014: 0-1: $Tloginid = _IEFormElementGetObjByName ($TsecCon_Form, "UserId")

0015: 0-1: $Tpasswd = _IEFormElementGetObjByName ($TsecCon_Form, "Password")

0016: 0-1: _IEFormElementSetValue ($Tloginid, "testuser")

0017: 0-0: sleep(50)

0018: 0-0: _IEFormElementSetValue ($Tpasswd,"pass")

0019: 0-0: sleep(50)

0021: 0-0: _IEFormSubmit ($TsecCon_Form,1)

--> IE.au3 V2.3-1 Warning from function _IELoadWait, $_IEStatus_AccessIsDenied (Cannot verify readyState. Likely casue: cross-site scripting security restriction.)

0022: 8-0: sleep(100)

0023: 0-0: _IELoadWait ($oIE)

0024: 0-0: WinSetState("", "", @SW_MAXIMIZE)

0030: 0-0: sleep(100)

0032: 0-0: $TsecConframe = _IEFrameGetCollection($oIE,0)

0033: 0-6: sleep(100)

0034: 0-0: $TsecCon_Form = _IEFormGetObjByName ($TsecConframe, "SecContainerForm")

0052: 0-0: $HexNumber = Hex($oIEErrorHandler.number, 8)

0053: 0-0: MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & "Number is: " & $HexNumber & @CRLF & "Windescription is: " & $oIEErrorHandler.windescription)

0056: 0-0: SetError(1) ; something to check for when this function returns

0057: 1-0: EndFunc ;==>MyErrFunc

0052: 0-0: $HexNumber = Hex($oIEErrorHandler.number, 8)

0053: 0-0: MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & "Number is: " & $HexNumber & @CRLF & "Windescription is: " & $oIEErrorHandler.windescription)

0056: 0-0: SetError(1) ; something to check for when this function returns

0057: 1-0: EndFunc ;==>MyErrFunc

--> IE.au3 V2.3-1 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch

0035: 7-0: $oSelect = _IEFormElementGetObjByName($TsecCon_Form, "secContainerName")

--> IE.au3 V2.3-1 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType

0037: 3-1: _IEFormElementOptionselect ($oSelect, "TEST", 1, "byValue")

--> IE.au3 V2.3-1 Error from function _IEFormElementOptionselect, $_IEStatus_InvalidDataType

0038: 3-1: sleep(10)

0039: 0-0: $TNextLink=_IELinkGetCollection($TsecConframe,0)

0052: 0-0: $HexNumber = Hex($oIEErrorHandler.number, 8)

0053: 0-0: MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & "Number is: " & $HexNumber & @CRLF & "Windescription is: " & $oIEErrorHandler.windescription)

0056: 0-0: SetError(1) ; something to check for when this function returns

0057: 1-0: EndFunc ;==>MyErrFunc

--> IE.au3 V2.3-1 Warning from function _IELinkGetCollection, $_IEStatus_NoMatch

0040: 7-2: _IEAction($TNextLink, "click")

--> IE.au3 V2.3-1 Error from function _IEAction, $_IEStatus_InvalidDataType

0041: 3-1: WinWait("Microsoft Internet Explorer","")

Link to comment
Share on other sites

Please see the remarks for _IEFormSubmit in the helpfile. It talks about this situation with a work around.

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

Hi Dale,

I used _IEAction() insetad of _IEFormSubmit().but getting same problem.only problem here is, when application deployed in remote machine it is not working...

same application if deployed in local machine it is working fine.

please refer the screenshot and below SCITE console log...

If anybody experinces same problem please let me know.

------------------------------------------------------------------------------------------------------------------

0013: 0-0: $TsecCon_Form = _IEFormGetObjByName ($oIE, "LOGIN_FORM")

0014: 0-1: $Tloginid = _IEFormElementGetObjByName ($TsecCon_Form, "UserId")

0015: 0-1: $Tpasswd = _IEFormElementGetObjByName ($TsecCon_Form, "Password")

0016: 0-1: _IEFormElementSetValue ($Tloginid, "testuser")

0017: 0-0: sleep(50)

0018: 0-0: _IEFormElementSetValue ($Tpasswd,"pass")

0019: 0-0: sleep(50)

0020: 0-0: $osubmit = _IETagNameGetCollection ($oIE, "SPAN",8)

0021: 0-13: _IEAction($osubmit,"click")

0024: 0-0: sleep(100)

0025: 0-0: _IELoadWait ($oIE)

0026: 0-0: WinSetState("", "", @SW_MAXIMIZE)

0032: 0-0: sleep(100)

0034: 0-0: $TsecConframe = _IEFrameGetCollection($oIE,0)

0035: 0-6: sleep(100)

0036: 0-0: $TsecCon_Form = _IEFormGetObjByName ($TsecConframe, "SecContainerForm")

0078: 0-0: $HexNumber = Hex($oIEErrorHandler.number, 8)

0079: 0-0: MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & "Number is: " & $HexNumber & @CRLF & "Windescription is: " & $oIEErrorHandler.windescription)

0082: 0-0: SetError(1) ; something to check for when this function returns

0083: 1-0: EndFunc ;==>MyErrFunc

0078: 0-0: $HexNumber = Hex($oIEErrorHandler.number, 8)

0079: 0-0: MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & "Number is: " & $HexNumber & @CRLF & "Windescription is: " & $oIEErrorHandler.windescription)

0082: 0-0: SetError(1) ; something to check for when this function returns

0083: 1-0: EndFunc ;==>MyErrFunc

--> IE.au3 V2.3-1 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch

0037: 7-0: $oSelect = _IEFormElementGetObjByName($TsecCon_Form, "secContainerName")

--> IE.au3 V2.3-1 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType

0039: 3-1: _IEFormElementOptionselect ($oSelect, "VeNoM", 1, "byValue")

post-32077-1204583081_thumb.jpg

Edited by rodex
Link to comment
Share on other sites

You're getting cross site scripting errors (access is denied) again. You'll need to figure out why the other system is different... the most likely cause is, again, the parent document and the frames are in different domains.

I have also seen this returned in the presence of some complex Ajax processing (like gmail login) because the content is being dynamically updated as you try to reference it. You may want to try to use _IELoadWait on the frame.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...