Forum Discussion

JBR's avatar
JBR
Occasional Contributor
10 years ago

TC10 - problems in flat mode.


Hi



I need help. I'm trying to open our project, that was used in TC7.



We use Embarcadero Delphi XE2.



We used "flat" mode (we had TC3 Compatibility plugin) and had no problems with ComboBoxes that were on different frames, because TC7 added them a number like:

p := Sys.Process('DMS');

w := p.fmEditForm230;

w.cbData.ClickItem('00;Fiat');

w.cbData_3.ClickItem('199;GRANDE PUNTO');

w.cbData_2.ClickItem('130.3;Active 1,2 65KM');

w.cbData_5.ClickItem('044;SZARY+CZARNY DACH');

w.cbData_4.ClickItem('108;Plusz niebieski');



All cbData are the same, but are on different frames (that are invisilbe in this mode). But in flat mode they were numbered.



Trying the same on new TC10 it doesn't add any numbers and cannot click to other than just one.



Is there a fix or setting that will help us? We use flat mode because we started in TC3, than we had TC7 (with TC3 Plugin) and now we've bought TC10. If we had to change all to "Tree" mode - it will cost us a lot.



Please help us:)


3 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Wojciech,

     


    Did you set the Object tree model project option to Flat in TestComplete 10? 


     


     


    Trying the same on new TC10 it doesn't add any number


    What numbers do you mean? These ones?


    w.cbData_3.ClickItem('199;GRANDE PUNTO');


    w.cbData_2.ClickItem('130.3;Active 1,2 65KM');


    It looks like this is the index of the window. So, make sure that the Index property is added to the mapping criteria of this object.


     


     


    The Flat mode is quite obsolete. Today, the Tree mode is used more often, and it's much easier to handle objects in this case. I can suggest that you use the following approach if you decide to migrate your test to the Tree mode:


    1. Run the recording of the test in TestComplete 10.


    2. Run the test execution in TestComplete 7.


     


    TestComplete 10 will record all the actions over your application that TestComplete 7 executes. You many need to modify the recorded test. However, it should be easier than creating the test from scratch.

  • JBR's avatar
    JBR
    Occasional Contributor
    I can write this a bit clearer:



    When we used TC7 (Flat mode, without namemapping) with TC3 plugin, it recorded like this:



    p := Sys.Process('DMS');

    w := p.fmEditForm230;

    w.cbData.ClickItem('00;Fiat');

    w.cbData_3.ClickItem('199;GRANDE PUNTO');

    w.cbData_2.ClickItem('130.3;Active 1,2 65KM');

    w.cbData_5.ClickItem('044;SZARY+CZARNY DACH');

    w.cbData_4.ClickItem('108;Plusz niebieski');



    The numbers ("_3", "_2", "_5", "_4") were added automatically (I think because of TC3plugin?)



    Now, when we opened our TC7 project in TC10 it cannot find cbData_3 and any other with the "_[number]". I've tried to record again this module and got something like:

    p := Sys.Process('DMS');

    w := p.fmEditForm230;

    w.cbData.ClickItem('00;Fiat');

    w.cbData.ClickItem('199;GRANDE PUNTO');

    w.cbData.ClickItem('130.3;Active 1,2 65KM');

    w.cbData.ClickItem('044;SZARY+CZARNY DACH');

    w.cbData.ClickItem('108;Plusz niebieski');



    Every "cbData" is a different combobox, but it's named the same (it's located on different frame). So now TC10 cannot click on other cbData, just the first one and it stops, because cannot find other items.



    Is there a possibility, that it will run without changing to Tree mode?



    Your idea about running TC7 and recording in TC10 is quite non-viable, because we have our project divided into various units and procedures. Running it means starting few procedures that makes one test.  Recording will put everything into one script.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Wojciech,

     


    As I said earlier, the difference in names occurs due to the fact that the Index property is used in mapping criterion for the cbData_* objects in TC 7, but isn't used in TC 10. The tool considers the Index property unreliable. Thus, it doesn't use it for mapping an object. You can create the Name Mapping template for your combo-box objects and specify the list of properties (the properties used in TC 7) to map them.


     


    Read the following articles for more information: