User Tag List

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

    recorded script failng during playback


    i have a windows based application. i have recorded certain steps using the recording feature of testcomplete. However when I try to run the script generated by the tool, it fails.

    below is the code generated by the tool:

    var w1;
    var p1;
    var w2;
    var w3;
    var w4;
    w1 = Sys["Process"]("Explorer")["Window"]("Shell_TrayWnd")["Window"]("ReBarWindow32");
    w1["Window"]("ToolbarWindow32", "Quick Launch")["ClickItem"]("Show Desktop", false);
    w1["Window"]("MSTaskSwWClass", "Running Applications")["Window"]("ToolbarWindow32", "Running Applications")["CheckItem"]("NetBeans IDE 5.5 - TOPS", -1, false);
    Sys["Process"]("java", 2)["SwingObject"]("MainWindow", "NetBeans IDE 5.5 - TOPS", 0)["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane")["SwingObject"]("ToolbarPool", "org.openide.awt.ToolbarPool", 0)["SwingObject"]("JPanel", "", 0)["Build"]["SwingObject"]("Toolbar$DefaultIconButton", "&Run Main Project", 2)["Click"](10, 12);
    p1 = Sys["Process"]("java", 3);
    w1 = p1["SwingObject"]("fLogin")["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane")["SwingObject"]("JPanel", "", 0);
    w1["SwingObject"]("JTextField", "", 0)["Keys"]("mona[Tab]");
    w1["SwingObject"]("JPasswordField", "", 0)["Keys"]("calsoft[Enter]");
    w1 = p1["SwingObject"]("fMain");
    w1["JMainMenu"]["Click"]("Master|Airport Airline|Airline");
    w2 = w1["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane");
    w1 = w2["SwingObject"]("JDesktopPane", "", 0)["SwingObject"]("Airline", "Airline", 0)["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane");
    w3 = w1["SwingObject"]("JPanel", "", 2);
    w4 = w3["SwingObject"]("JTextField", "", 1);
    w4["Click"](23, 9);

    The script is failing at line

    w2 = w1["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane");

    The error I get in the log is "Unable to find Object"

    What might the cause of failure?
    I have not changed anything in the generated script.

    Thanks in advance.


  2. #2
    Senior Member
    Join Date
    May 2004
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)
    Total Downloaded

    Re: recorded script failng during playback

    Hi Montap,

    The error means that TestComplete was unable to find an object. I cannot say for sure exactly what object is not found since I do not have your application to check this, so you need to debug the script yourself. The general approach to debugging such errors is as follows:

    1. Set a breakpoint on the problematic line.

    2. Launch your script and let it run until the execution is stopped on the breakpoint.

    w2 = w1["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane");

    3. Once the execution is stopped, make sure that all objects used in the problematic line exist. To do this, select the 'w1' text in the line and press the Ctrl-F7 shortcut. This will open the Evaluate dialog, and the 'w1' expression will be evaluated. If an error occurs, you will see the text of the error in the 'Result' pane. If the result of the expression is a value of a simple type (string, int, float, bool), you will see this value in the 'Result' pane. If the result of the expression is an object (e.g. a window object in case of the 'w1' expression), you will see the '[Object]' text in the 'Result' pane. In this case, you can click the 'Inspect' button to invoke the 'Inspect' window. In the window, you can see all properties and methods of the object.

    4. Make sure that the 'w1' object exists by using the Evaluate dialog described in step 3.

    5. Make sure that all other objects exist:
    - w1["SwingObject"]("JRootPane", "", 0)
    - w1["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")
    - w1["SwingObject"]("JRootPane", "", 0)["SwingObject"]("null.layeredPane")["SwingObject"]("null.contentPane")

    6. Once you find an object that cannot be obtained correctly (an error is displayed in the 'Result' pane), open the 'Object Browser' panel and see whether this object exists in the tree.

    7. Correct your script to make it use the correct object that exists in the object tree instead of the currently used object.

    Please let me know your results.
    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.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 09:06 PM.

Copyright BetaSoft Inc.