Ok so I've hit an ANNOYING snag in my automation travels at my New Co. which is starting to drive me NUTS.
Apparently, on one of their Web Apps, the client couldn't tell when the application was processing something and therefore busy. This is in part due to the fact that when the application login is successful, they render it in a popup with no navigation or menus or anything. So you can't see the "e" spinning or the progress bar. I also suspect they are using a lot of AJAX calls as well but I digress
To solve this problem, New Co. put in this feature where if the app is processing something the screen greys out. Cute? Yes. Informative to a human? Yes. Valuable to an automated test strategy? NO!
And Here's why: This "grey out" feature does not put the browser into a non-Ready state. Now you may be wondering why this is such a big deal...I mean...surely the browser remaining in a Ready state is a great thing...right?
No--its not. It sucks..and I'll tell you why. The reason it sucks is that it makes "Sync" totally useless. Sync basically asks the browser, "Are you done yet?" before attempting to proceed with the next lines of code. Totally eliminates the need for the dreaded "Wait" statement. Which is the automation equivalent of using a sledgehammer to open a peanut.
So what do I have to do to get around this? I have to essentially make my own sync. The annoying part of this is that I can't really use the same "sync" across the application. I have to have one for each action I'm working on. At least that's what I've been able to deduce for now, investigations into a more elegant solution continue.
For example:
'Verify Link under test exists
blnFound = False
intcount = 1
Do While blnfound = False
If Browser(Environment("BrowserHandle")).Page(Environment("PageHandle")). _
& Link("innertext:="&strLinktext).Exist(0) Then
blnfound = True
Else
blnfound = false
intcount=intcount + 1
Wait(2)
If intcount > 10 Then
Exit Do
End If
End if
Loop
So I basically have to turn what should be one line of code (Browser(Environment("BrowserHandle")).Page(Environment("PageHandle")).Sync ) into 14 lines of code, not including the DIM statements b/c I always use Option Explicit for my scripts.
And if I forget to build one of these little gems, the script runs so fast that I end up getting an application generated ViewState mismatch error OR it can't find the next object it needs b/c either the object is disabled thanks to that grey out dealie...or it doesn't exist yet b/c the application is attempting to navigate to the page where that object lives.
ARGH....
Anyone have any suggestions on this? Aside from asking the devs that when the app greys out to put the browser in a non-ready state...which I am planning to do btw.
(sigh)