SPONSORS:






User Tag List

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

    How to write script to compare saved web page

    Hi, I want to compare the web page saved in my system with running application.
    what i want to do:
    1. Using wecheckpoint store the web object in stored and copy it to my convinient directory.
    2. Now want to compare stored object with running webpage.

    For webcheck point we have to predifined method "WebTesting.WebCmp1.Compare". it is not working for web page stored in different location.

    Please help me if any method is available.

  2. #2
    Senior Member
    Join Date
    May 2004
    Posts
    1,196
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to write script to compare saved web page

    Hi,

    Could you please clarify what you mean by saying that the Compare method does not work for you? Please let me know how you call it and what results you get.
    Best regards,
    David - SmartBear Support

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

    Re: How to write script to compare saved web page

    Hi David,

    Thanks for your reply.
    Web page saved in Stores folder (saved by using webtesting checkpoints) can be compared by using following code:
    if (! WebTesting.WebCmp1.Compare(webPage, true))
    Log.Error("The \"WebCmp1\" web comparison checkpoint failed.")

    but if i save same webpage in any other directory, i am not able to use same method for comparing webpage elements. Even i didnt found any other method to compare webpage.

    Let me know if its possible in testcomplete.

  4. #4
    Senior Member
    Join Date
    May 2004
    Posts
    1,196
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to write script to compare saved web page

    Hi,

    [ QUOTE ]
    but if i save same webpage in any other directory, i am not able to use same method for comparing webpage elements.

    [/ QUOTE ]It is not clear to me what other directory you mean. The Compare method accepts a Page object and compares this page with the page saved in the Stores collection.

    If you create a Web Comparison checkpoint with a page opened in Internet Explorer, code similar to the following code will be generated:
    <font class="small">Code:</font><hr /><pre> if(!WebTesting.WebComparison2.Compare(Sys.Process( "IEXPLORE").Page("*"), true))
    Log.Error("The \"WebComparison2\" web comparison checkpoint failed.");</pre><hr />

    If you now want to use this checkpoint to validate the same page opened in a browser, embedded in a Windows GUI application, you just need to correct the path to the Page object:
    <font class="small">Code:</font><hr /><pre> var page = Sys.Process("MyProcess").WinFormsObject("WebBrowse r").WinFormsObject("webBrowser1").WinFormsObject(" Shell Embedding", "").Window("Shell DocObject View", "", 1).Window("Internet Explorer_Server", "", 1).Page("*");
    if(!WebTesting.WebComparison2.Compare(page, true))
    Log.Error("The \"WebComparison2\" web comparison checkpoint failed.");</pre><hr />
    Best regards,
    David - SmartBear Support

 

 

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.54%
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 01:54 AM.

Copyright BetaSoft Inc.