SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Apprentice
    Join Date
    Jun 2006
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    JavaScript error detection by QTP

    Hello Experts, could you please help me answer the following question?

    Question:

    How QTP recognizes/identifies a JavaScript error that appears on the page (in the bottom left corner on the status bar)?

    Scenario:

    At times, the Java based application throws JavaScript error. I am trying to automate this. If JavaScript error occurs, the script is failed. If it doesn't, then script is successful. There is an option in IE settings, by which the JavaScript error can only be displayed in status bar and it doesn't popup the error on screen.

    I am searching for a way by which I can identify this error in the status bar and then based on that decide whether my script failed or passed.

  2. #2
    Apprentice
    Join Date
    Jun 2006
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    More info.: Once, error is identified, I wanted to halt the execution of script and report to the result file that there was a javascript error.

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    It would not be good option to read the error in the status bar rather then the error window, the best approach to go about this would be to configure IE settings in the start of the script and uncheck the check box for "Disable Script debugging" and then make a recovery scenario for the java script error popup.

  4. #4
    Advanced Member
    Join Date
    Aug 2007
    Location
    Six Feet Under
    Posts
    717
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    hi Tarun,
    [ QUOTE ]
    make a recovery scenario for the java script error popup.

    [/ QUOTE ]

    but it is not working and give wired message "the dialog box or window you clicked does not have any buttons"

    Please find both the screen shot
    1) showing message giving by QTP
    2) javascript Error window

    is there any other way to catch these type of error using IE object Or it there any QTP function.


    Sometime we can catch these error by showing screen shots, but it is only possible if these types of errors are coming at the end, but sometime it comes in between and lost with the very next event fires internal or external so in that case catching those error wont be possible in IE, These Errors are very important to be fixed because it affects in long term. it may appear in Clients Browser.


    Regards,
    Manish Bansal
    Attached Files Attached Files
    Thanks,
    Manish Bansal

    Checkout Blog Page At
    http://www.softtechlabs.com

  5. #5
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    I had a look the the window and it seems the error message is displayed inside a web browser. So the window inside does not have any button and hence you are getting the correct response from recovery scenario.

    QTP is not able to recognize the child browser and hence there is nothing that can be done by using this approach as such.

  6. #6
    Advanced Member
    Join Date
    Aug 2007
    Location
    Six Feet Under
    Posts
    717
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    [ QUOTE ]
    error message is displayed inside a web browser.

    [/ QUOTE ]
    Yes, Agreed.

    [ QUOTE ]
    So the window inside does not have any button

    [/ QUOTE ]
    Tarun, i did not get you, in this popup (javascript_error_.jpg) i can see four button
    1) OK
    2) Hide Details <<
    3) Previous and
    4) Next (disabled)

    [ QUOTE ]

    there is nothing that can be done by using this approach as such.

    [/ QUOTE ]

    so how to handle this query which is posted by original author, Please specify some other approach.
    [ QUOTE ]
    I am searching for a way by which I can identify this error in the status bar and then based on that decide whether my script failed or passed.

    [/ QUOTE ]

    Regards,
    Manish Bansal
    Thanks,
    Manish Bansal

    Checkout Blog Page At
    http://www.softtechlabs.com

  7. #7
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    What you see are not WinButtons. They are button of a webpage displayed in the browser control inside the dialog that why QTP does not see them. I am trying to find some info on this. Will post if i find something.

  8. #8
    Senior Member
    Join Date
    Feb 2008
    Location
    Los Angeles, CA, USA
    Posts
    861
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    Try either of these options,

    Public Sub CloseJavaScriptError()

    '-----------------------------------------------
    If window("regexpwndtitle:=Internet Explorer").Exist(2) Then

    window("regexpwndtitle:=Internet Explorer").Page("title:= Internet Explorer").WebButton("html tag:=BUTTON", "html id:= btnOK").Click
    End If

    End Sub

    '-----------------------------------------------

    Call this function for your recovery scenario. It works for me.

    OR

    In "Recovery Operation" - step for the screenshot you have attached, just select the first option - Press default / ENTER button

    '-----------------------------------------------
    -Suchit

  9. #9
    Advanced Member
    Join Date
    Aug 2007
    Location
    Six Feet Under
    Posts
    717
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    [ QUOTE ]
    I am trying to find some info on this. Will post if i find something.

    [/ QUOTE ]
    nice, thanks tarun
    even i'll try someting form my side on this [img]/images/graemlins/smile.gif[/img]

    Regards,
    Manish Bansal
    Thanks,
    Manish Bansal

    Checkout Blog Page At
    http://www.softtechlabs.com

  10. #10
    Advanced Member
    Join Date
    Aug 2007
    Location
    Six Feet Under
    Posts
    717
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: JavaScript error detection by QTP

    I think the first option is looking better i'll trying this now !

    Suchit, it worked like Charm
    Thanks [img]/images/graemlins/smile.gif[/img]

    Regards,
    Manish Bansal
    Thanks,
    Manish Bansal

    Checkout Blog Page At
    http://www.softtechlabs.com

 

 
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.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:42 AM.

Copyright BetaSoft Inc.