SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Member
    Join Date
    Feb 2007
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    WR: Capture IE hang state

    Hello All,
    I want to capture IE hang state through WR. The reason I need this is IE crashes in the middle of WR batch run. I havent found any replies for that here or could fetch any reasons myself. The reason I need this capture is I want to write a WR routine that would capture IE hang state and then kill the process and reopen browser to continue batch execution. By IE hang state I mean browser is inoperable and no action could be performed and in this state WR cannot identify any objects on IE, as first IE needs to be forcibly shutdown.

    -Thanks

  2. #2
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    The best way to write tests for batch execution is to assume the browser is crashed (or in an unknown state) and kill all iexplore.exe processes before launching a new browser and starting execution. Write a series of short tests (each should be around 5 minutes). Each test starts out by closing / killing all browsers then launching a new one. This way, if you get a crash, it will only affect one subtest. Do a search for "Browser Close"

  3. #3
    Member
    Join Date
    Feb 2007
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    Thank you for the response.

    My question here is while I am running around 50 scripts in batch, batch fails around the 5th or the subsequent script. Are you saying to code in a way when a new script within the batch is invoked, kill all the browsers and start a new one? If that is the case wouldnt that defeat the purpose of user simulation. I havent been able to resolve IE issue why it crashes so my question is - whenever IE crashes in the middle of a run, is there a way for WR to sense this and close the browser and start a fresh instance of IE? The routine I am talking about would be on the lines of an exception handler.

    Thanks again

  4. #4
    Moderator
    Join Date
    Aug 2001
    Location
    NC
    Posts
    6,041
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    Improve, this is really enforcing the scientific basis of testing: Set and confirm your proper documented initial conditions at the beginning of your test. Otherwise you may enter into the realm of the chaotic "butterfly effect" where small variations in initial conditions can result in wildly different end conditions.

    Food for thought,

    'Pulley
    James Pulley

    Replace ineffective offshore contracts, LoadRunnerByTheHour. Starting @ $19.95/hr USD.

    Put us to the test, skilled expertise is less expensive than you might imagine.

    Twitter: @LoadRunnerBTH @PerfBytes

  5. #5
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    [ QUOTE ]
    Improve, this is really enforcing the scientific basis of testing: Set and confirm your proper documented initial conditions at the beginning of your test. Otherwise you may enter into the realm of the chaotic "butterfly effect" where small variations in initial conditions can result in wildly different end conditions.

    Food for thought,

    'Pulley

    [/ QUOTE ]

    Chaos Theory.
    Edward Lorenz. 1960.
    Never heard it applied to QA Automation, but it does make sense.
    Nice extrapolation, Pulley.

  6. #6
    Member
    Join Date
    Feb 2007
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    I got to rephrase my query as issue is losing its track. My issue is IE crashes in the middle of a batch run. I couldnt figure out the reason. Now till i figure out the problem I want to continue with batch execution without halt. My thought to do this is to make WR capture IE hang state, kill browser and open a new one and continue with the next script. My question is can I make WR capture IE hang state.

    [bpolitzer]-Each test starts out by closing / killing all browsers then launching a new one.

    This I didnt want to do and might help me with batch execution but in real time for most apps the user doesnt login and logout for each transaction. I do close all the browsers before WR is initiated so my start and end conditions seem to be stable.

    Thanks again for the discussion and looking forward to replies.

  7. #7
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    OK - that makes it a little more clearer!

    We have had the same issue when our server has hung up on us. How we got around it was creating a small vb applet where you call it with a paramter of a length of time that is considered "max script time". Once this time is exceeded, it pops up a standard message box. This box can be detected via a popup exception in WR to perform the steps needed to end the current test and setup to continue with the next.

    see if all this convoluded stuff helps your situation:
    Here are the functions we have (change them to as you need, the TIMEOUT constant is a constant we use to decide wether or not to force the timeout of scripts = you can change the code to not use this or utilize it as well)
    <font class="small">Code:</font><hr /><pre>
    public function strcat(inout ps_str1, in ps_str2)
    {
    ps_str1 = sprintf("%s%s",ps_str1,ps_str2);
    }

    public function kill_process(in ps_process, in ps_server, in ps_user, in ps_pass)
    {
    auto s_command = "\"" &amp; getenv("M_ROOT") &amp; "\\arch\\pskill\"";

    if (ps_server !="")
    {
    strcat(s_command," \\\\");
    strcat(s_command,ps_server);
    }

    if (ps_user != "")
    {
    strcat(s_command," -u ");
    strcat(s_command,ps_user);
    }

    if (ps_pass != "")
    {
    strcat(s_command," -p ");
    strcat(s_command,ps_pass);
    }

    strcat(s_command," ");
    strcat(s_command,ps_process);
    dos_system(s_command);
    }

    public function script_timer(in pb_state)
    {
    auto s_invokedfile = getenv("M_ROOT") &amp; "\\arch\\timeout.exe";
    extern n_scripttime;
    extern TIMEOUT;

    if (TIMEOUT)
    {
    if (pb_state) #ON
    {
    invoke_application(s_invokedfile, n_scripttime, "", SW_HIDE);
    }
    else #OFF
    {
    kill_process("timeout.exe");
    }
    }
    }

    </pre><hr />

    I have attached the pskill.exe and the timeout.exe files which need to be extracted to your arch folder in WinRunner if you use the same code as above, or change the code to have them stored where you wish.

    The following popup exception will need to be added to your scripts to allow the detection of the window:

    <font class="small">Code:</font><hr /><pre>
    define_popup_exception("TimeOut","Script_Timeout", "MAXIMUM TIME EXCEEDED");
    </pre><hr />


    The exception function we have set up is the following
    <font class="small">Code:</font><hr /><pre>
    public function Script_Timeout()
    {
    extern s_reportname;
    extern ERROR;

    win_activate("{class: window,label: \"MAXIMUM TIME EXCEEDED\",MSW_class: \"#32770\"}");
    set_window("{class: window,label: \"MAXIMUM TIME EXCEEDED\",MSW_class: \"#32770\"}",1);
    button_press("{class: push_button, label: OK}")
    scriptexit();
    }
    </pre><hr />

    scriptexit() will contain the steps you need to do to recover from the locked up IE sessions, log what you need to, etc
    Attached Files Attached Files
    Insanity: doing the same thing over and over again and expecting different results

  8. #8
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    Tony:

    This code doesn't actually detect if the Internet Explorer message queue has stopped processing, does it? Also, a non-responsive browser shouldn't halt execution in batch mode unless you code potential infinite loops:

    Eg:

    <font class="small">Code:</font><hr /><pre>
    while(win_exists("SomeWindow") != E_OK)
    {
    wait(1);
    }
    </pre><hr />

    Instead of:

    <font class="small">Code:</font><hr /><pre>
    InitialTime = get_time();
    while((win_exists("SomeWindow") != E_OK) &amp;&amp; ((get_time() - InitialTime) &lt; 60))
    {
    wait(1);
    }
    </pre><hr />

  9. #9
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    You are correct. It doesn't detect the browser hanging, more that something has gone wrong to prevent the test from completing with an expected time frame.

    How we chose to go about it was if the test should normally run in 20 minutes, if it hasn't competed in 2 1/2 times that time slice, then something has happened. We also consider on our end that it isn't just the browser that has encountered an issue as we have services that run on the web and app server which may cause an unresponsive client IE window.

    If the time limit is exceeded, the client IE is killed, and the services on the servers are stopped and restarted to clear out any error they might have introduced and we go back and review the run logs to try to reproduce the issue for troubleshooting/logging. Our application is deployed via an IE browser window, but with all the SOAP connections, java script, vb script and .NET scripting that is included in how it runs correctly, there is far more to consider causing hangups.

    Just our way of going about it (basically throwin my two cents into the fray with one possible solution)
    Insanity: doing the same thing over and over again and expecting different results

  10. #10
    Member
    Join Date
    Feb 2007
    Posts
    89
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: WR: Capture IE hang state

    OK..Firstly thanks a lot for such detailed analysis and responses, I couldnt thank you all enough!
    I had just now typed an entire message and by the time I hit submit, it said form expired use back button and when I did,what I typed was lost so have to recollect my thoughts with questions and plug them into this message :-(

    Tony - So, the module that you have sent over is dependent on the script duration that needs to be defined right!? this I couldnt as every script in my batch has its own time period. it is dependent on the duration of a file download(between 30secs to 600secs) at the end of the script. IE crash occurs midway in any script when I hit 'submit' button so even if I did define a script average time, exception might be invoked in a wrong context bcos download might have taken longer.

    &lt;bpolitzer&gt;Also, a non-responsive browser shouldn't halt execution in batch mode unless you code potential infinite loops

    Batch execution exactly doenst halt but rest of all the scripts fail bcos IE is in hang mode and WR cannot identify any of the objects on the remaining scripts. I will explain my question again - there is an IE crash issue, bcos of which I am running a batch script with 60 in 10-15 phases with 4-6 scripts. this is the reason I want to capture IE crash and then let WR continue batch execution rather than manual restart of batch post execution of 4-5 scripts.

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 9.68%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:20 PM.

Copyright BetaSoft Inc.