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
    Sep 2007
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    web page loading with javascript errors

    How do you determine if a IE web page loaded but with errors on page?

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    1,049
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: web page loading with javascript errors

    Hi,

    You can catch the corresponding error message when it is displayed in the IE status bar by making TestComplete handle IE events. To do this, please follow the steps below:
    1. In the Project Explorer panel, right-click the Events project item of your current project (add the item if it does not exist).
    2. Select the "Add | New Item..." context menu item and add a new event control (e.g. MyEventControl).
    3. In the Workspace panel, click the ellipsis button near the "Source object" edit box.
    4. In the "Select ActiveX Library" dialog, select the "Microsoft Internet Controls" item and click OK.
    5. Expand the "InternetExplorer.Application.1" node and double-click the StatusTextChange item.
    6. In the "Events to Handle" pane, right-click the corresponding node and select the "Add Event Handler" context menu item.
    7. In the "New Routine" dialog, Click OK.
    8. Insert the following code into the routine body:

      <font class="small">Code:</font><hr /><pre>'VBScript
      Sub MyEventControl_StatusTextChange(Sender, Text)
      If InStr(Text, "Error") &gt; 0 Then
      Log.Error "There is an error on the page"
      End If
      End Sub
      </pre><hr />

      The event handler will post the relevant message to the test log every time the needed status text is set in the IE status bar.
    9. To attach the event handler to the needed Page object, place the following code to the routine where the Page object is obtained:

      <font class="small">Code:</font><hr /><pre>' VBScript
      '...
      Events.MyEventControl.AttachTo(Sys.Process("iexplo re").Page("*"))
      '...
      ' work with the page
      '...
      Events.MyEventControl.DetachFrom(Sys.Process("iexp lore").Page("*"))
      '...
      </pre><hr />
    Regards,
    Allen - SmartBear Support

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

    Re: web page loading with javascript errors

    It works great.

    Thanks Allen.

    gene

 

 

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 10.00%
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 09:56 AM.

Copyright BetaSoft Inc.