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
    Aug 2006
    Location
    Serbia
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Problems with Simulating mouse click !

    I am new in QA area and I use TestComplete Demo for learning.
    When I Rrecord some script I see simulation Mouse Click as this:
    w2.Page('http://w01/v51c/admin/productsmodifications.asp?level=1&ID=5&nam e=Prevozna+sredstva').document.all.Item(418).Click (42, 2);
    If this record script reproduct new line on page "productsmodifications.asp?level=1&ID=5&na me=Prevozna+sredstva"
    I can't use this script for the second time because, now Click(42, 2)isn't the same as before the first using script.
    How I can resolve this problem?

  2. #2
    Junior Member
    Join Date
    Aug 2006
    Location
    Serbia
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problems with Simulating mouse click !

    If I have page with 3 links:
    Link1
    Link2
    Link3
    How can I simulate mouse click on Link2 without remember his position? Example by name.
    After the first using this test I have 4 links.
    Link1
    Link1
    Link2
    Link3
    How can I simulate mouse click on Link2 now?

  3. #3
    Junior Member
    Join Date
    Aug 2006
    Location
    Serbia
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problems with Simulating mouse click !

    I didn't find how I can resolve my problem. Did anybody have a problem as I? Can TC recognise Items on web pages on another way than position like as w2["Click"](214, 10);.For my web testing remember position is not good because my application is much changeable.

    Thak you for any kind of answer.

  4. #4
    Senior Member
    Join Date
    Oct 2003
    Posts
    928
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problems with Simulating mouse click !

    Hello Darko,

    TestComplete can simulate mouse clicks on web page elements without using coordinates.
    In your script, a mouse click is executed on the "Item(418)" object: 42 and 2 are the coordinates of the point where the click is performed relative to the left-top corner of the link object - if you do not specify the coordinates, the click will be executed in the center of the object.

    Please note that TestComplete can address web page elements by their native names.
    If the "ID" and "Name" attributes are not specified for an object, the tool uses an index to identify the object ( like in your case: Item(418) ).
    It is not reliable to use indexes in scripts because they may change from one page loading to another.

    I think your script fails due to index changing.

    To solve the problem, you can do any of the following:
    1. Assign a unique ID to the link object on your web page and address the object in script using this ID (TestComplete will also use this name during recording);
    2. Use the "Page.NativeWebObject.Find" method to find the link object - this method allows finding an object on a web page by a property value.
    For example, the following script searches for a link object by its URL and clicks it:

    <font class="small">Code:</font><hr /><pre>
    // DelphiScript
    ...
    // Get a reference to the current web page
    page := w.Page('*');
    // Find the needed link
    MyURL := 'http:\\www.My_URL.com\about.html';
    link := page.NativeWebObject.Find('href', MyURL);
    // Click the link
    if link.Exists then
    link.Click();
    ...
    </pre><hr />

    Please see the "Find Method" and "Page.NativeWebObject.Find" help topics for more information and let me know if you have any additional questions.

    Also I recommend that you refer to the "Web Testing" help topic that contains some basic information on how to test web pages using TestComplete.
    Regards,
    Alex - 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:32 AM.

Copyright BetaSoft Inc.