sammy1983 Posted March 9, 2014 Share Posted March 9, 2014 Hi, Is there a way that script can throw a message when the login fails? I have a webpage (internal) which says "Invalid Login Information" and it's in span tag. <span class="error"> Invalid Login Information. </span> I am able to bring this in a Msgbox however, it keeps popping even on Genuine login. Here is my code: Local $oForms = _IEFormGetCollection($oIE) For $oForm In $oForms If $oForm.name = "loginForm" Then MsgBox(0, "Warning", "Incorrect Login Credentials. Please try again") Exit EndIf Next Any help is appreciated. Thanks. Link to comment Share on other sites More sharing options...
orbs Posted March 10, 2014 Share Posted March 10, 2014 your code does not check for the string "Invalid Login Information". it checks for any form named "loginform". why are you so sure that the "loginform" only appears when login fails? Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
FireFox Posted March 10, 2014 Share Posted March 10, 2014 Try this : $oSpans = _IETagNameGetCollection($oIE, "span") For $oSpan In $oSpans If $oSpan.className() = "error" Then If StringInStr($oSpan.innerHTML, "Invalid Login Information.", 2) Then ConsoleWrite("found !" & @lf) EndIf EndIf Next Br, FireFox. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now