SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to get the text of an IE message box?

    Hi,

    I am testing a web app, and I have a bug that triggers a JavaScript message box with an error message. After the user clicks the Ok button, the page with the server exception is shown.

    I want to capture the error text shown in the JavaScript message box - TP identifies it as a Label control.

    I have tried using Window("IE_message_box").text (where 'IE_message_box' is the name of the object in the object map), but I can only get the caption of the message box, in my case 'Microsoft Internet Explorer'. 'CaptureText' returns empty string.

    The question is: How do I get the text of the label?

  2. #2
    Senior Member
    Join Date
    Sep 2001
    Location
    Philly
    Posts
    1,231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the text of an IE message box?

    If captureText is returning nothing it leads me to believe you are not pointing to the correct window with your IE_message_box window. CaptureText pulls in all visible text on an object and should work in the scinario you are describing.

    If you want to go down to the label level... try this:

    Window("IE_message_box").attach
    theText = Label("Index=1").Caption
    ~Alias~

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

    Re: How to get the text of an IE message box?

    This is probably not really portable, but for IE I managed to grab the message box text using the 'Window.Children' attribute.

    Considering that an IE message box has three children - the icon, the text, and the button, - I was able to get the text of the label with an expression like the one below:

    sText = Window("Caption='Microsoft Internet Explorer'").Children(2)

 

 

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 12:48 AM.

Copyright BetaSoft Inc.