WebApp is busy, but browser is "Ready"

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)

posted @ Wednesday, October 22, 2008 9:24 AM

Print

Comments on this entry:

# re: WebApp is busy, but browser is "Ready"

Left by Mike Tierney at 10/28/2008 1:43 PM
Gravatar
Hi MaryAnne - here is a low-tech solution(unless you REALLY need to do totally unattended testing) Instead of all that other logic, put the line
msgbox "click OK when the greyed -out screen goes away"
before every sync point in your test. After you get this rolling, you will be in better shape to think of a more elegant solution -somewhere in the universe one exists- given time and exposure to your app, I could probably come up with one.. at least just one VBScript Sub that did the sync'ing part & just pass it the various sync points of interest as args... Writing individual custom logic around every sync point is not elegant. tell your boss that overnight testing stuff is mostly tool vendor snake oil anyway<g>. cheers - Mike Tierney

# re: WebApp is busy, but browser is "Ready"

Left by MES at 10/30/2008 11:45 AM
Gravatar
Unfortunately we're expected to have "totally unattended" execution. IE Overnight type runs eventually. :( So I've got to battle this thing. I'll keep you guys posted on my progress. :)

# re: WebApp is busy, but browser is "Ready"

Left by dp at 11/25/2008 9:21 AM
Gravatar
Not sure fi this would work but what happens if you mange to override the in built sync functionlaity with your customised sync functionality ... i.e search for 'Registering User-Defined Test Object Methods' in QTP help.

# re: WebApp is busy, but browser is "Ready"

Left by MES at 11/25/2008 4:55 PM
Gravatar
I am using a custom SYNC already which checks to make sure the Browser, or Browser.Page or Browser.frame object is reporting a ready status. The "greyed out" screen does not appear to put the browser in a non-ready status. My guess is that it is an AJAX call and therefore doesn't cause the browser to refresh. :(

# re: WebApp is busy, but browser is "Ready"

Left by joginder at 4/6/2009 1:11 AM
Gravatar
This is AJAX Controls Problem.I we cant know that how QTP hanle(Recognize) Ajax controls then only we can solve this problem. If anubody have idea regarding ajax with QTP send me the details. Then i will surely solve this syncronazation problem.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345