The website in question is at https://employercenter.regence.com. Unfortunately I cannot provide a login since the site deals with sensitive personal information. However, most of the problems I am having can be experienced on this login page as well.
Using the macro I've written, I can launch an IE instance and navigate to the site using with no problem. However, once I'm there, many of the "IE[whatever]" functions seem not to work properly.
For instance, I can get to the site using IENavigate, but once there I cannot use IENavigate again to get to any other site (whether it's another page on the same site, or another site entirely).
The IE functions do seem to work from other sites. For example, I can IENavigate to Google, use IEFormFill to enter a search term, IEFormSubmit to initiate the search, and so on. If I then IENavigate to the Regence site, I get there just fine. But if I then attempt to IENavigate back to Google, nothing happens.
One possible suspect I've found is that the page has a few instances of broken HTML tags, at least according to IE10's console. I wouldn't expect that to be the problem, since I presume Macro Scheduler is using IE's API and the site works fine in IE itself, but maybe I'm wrong about that?
The IE functions usually return an unsuccessful result for the return value, but I have not seen any indication of what the error could be while in the debugger. Of particular concern to me is the fact that IEWaitDocumentComplete always times out and returns 0, which suggests to me that it never recognizes the page as having been fully loaded and thus can't parse it. If that's the case then it would certainly explain some things.
It's also worth noting that I can navigate the site using image recognition and mouse/keyboard functions. But that's obviously kind of fragile, and in any case it won't be adequate for some of the things I intend to do after logging in.
Sadly, I have no control over the site in question, so I have to be more focused on workarounds than real solutions if the problem is indeed something that has to be fixed on the site (as I suspect). I have tried disabling Javascript in IE in the hopes that some client-side script was interfering with the macro, but did not see any change in behavior.
For reference and testing, here is my macro:
Code: Select all
MouseMove>0,0
Let>delay=1
//URL's and credentials
Let>google=http://www.google.com
Let>loginURL=http://employercenter.regence.com
Let>formName=dsmartSignon
Let>username=mylogin
Let>password=mypassword
//Enable automatic downloads to My Documents dir, modify path if required
IEOnDownload>1,,ie_res
//Set timeout for ClickTag and FormFill to 10 seconds, increase if pages load more slowly
IESetTimeout>10,ie_res
//My IE instance
IECreate>IE[0]
//To prove that IENavigate itself works, go to Google
IENavigate>IE[0],google,ie_res
//Store current URL, just to test IEGetURL
IEGetURL>IE[0],curUrl
//Test form fill/submit by doing a search
IEFormFill>IE[0],,gbqf,q,Macro Scheduler,,ie_res
IEFormSubmit>IE[0],,gbqf,ie_res
IEWaitDocumentComplete>IE[0],ie_res
//Now go to the actual site I'm working with. ie_res is 0 (good) after IENavigate, but still 0 (bad) after IEWaitDocumentComplete
IENavigate>IE[0],loginURL,ie_res
IEWaitDocumentComplete>IE[0],ie_res
//Try getting current URL again. Note how this time it gets nothing
IEGetURL>IE[0],curUrl
//Try to go back to Google. Nothing happens, and ie_res gets set to 1
IENavigate>IE[0],loginURL,ie_res
// Log into the site
Gosub>doLogin
//Attempt to close the window (this also doesn't work)
IEQuit>IE[0],ie_res
// Login function
SRT>doLogin
//Attempt to fill in form with IE functions (doesn't work)
//username
IEFormFill>IE[0],,formName,USER,username,,ie_res
//password
IEFormFill>IE[0],,formName,PASSWORD,password,,ie_res
//submit
IEFormSubmit>IE[0],,formName,ie_res
//Fill in login form using img-rec and mouse/keyboard functions (this works, using images I captured with the wizard)
//username
FindImagePos>%BMP_DIR%\username_field.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
Wait>1
LClick
Send>username
Endif
//password
FindImagePos>%BMP_DIR%\password_field.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
Wait>1
LClick
Send>password
Endif
//submit button
FindImagePos>%BMP_DIR%\login_button.bmp,SCREEN,0.7,1,XArr,YArr,NumFound,CCOEFF
If>NumFound>0
MouseMove>XArr_0,YArr_0
Wait>1
LClick
IEWaitDocumentComplete>IE[0],ie_res
Endif
END>doLogin