Forum Discussion

Oferv's avatar
Oferv
Super Contributor
13 years ago

checkpoint maintenance

Hi,



i'm standing in front of a conflict.

i created a script that test an installation/uninstall in english.this script has checkpoints through all the way.now, there are other installation for few more languages except english and the checpoints i created for text displayed during the english installation include an english text,means when i'll run the japanese installation for example,the script will fail.my conflict is, do i have to create now new checpoints for each and every language separately?or is there a way to make TC know what language i run right now?or is there any other solution for this problem?



thanks

9 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    As powerful as checkpoints are, this is one of the disadvantages of them in that, for many situations, they are effectively "hard coded" for the situation in which they were created.  This is where a data-driven test scenario would work best where you have some sort of data source (CSV, Excel, etc) that contains the values to be compared to the actual on screen values and then call that data during the course of your tests.  You could, then, have different data files for different language sets so that all you would have to do is replace one file with another and re-run your tests.



    Roughly, what I would do, is have something like an EnglishCheckpoints.CSV, a JapaneseCheckPoints.CSV, etc.  Each CSV file would contain two columns.  The first column would be the component name whose property/value you are checking.  The second column would be the value to be checked.  Then, as you run through your code, you would call up the record from the CSV based upon the component and compare the value in the file then to the value on the screen.
  • Oferv's avatar
    Oferv
    Super Contributor
    I see,

    so please check this lines and let me know if this the right way of doing what you just said.




    if(NameMapping["Sys"]["Process"]("pdfcreator10enc_x64")["Window"]("", "", 1)["Window"]("Static", "xxx Setup is preparing the InstallShield Wizard, which will guide you through the program setup process.  Please wait.", 2)["WndCaption"] == DDT["CurrentDriver"]["Value"]("CheckPoint"))

        Log["Message"]("PASS "  + DDT["CurrentDriver"]["Value"]("Component")  + " Checkpoint")

      else

        Log["Error"]("FAIL " + DDT["CurrentDriver"]["Value"]("Component") + " Checkpoint")



    just want to be sure i'm doing it the right way.

    B.T.W is there a way to shortcut the long term of NameMapping["Sys"]["Process"]("pdfcreator10enc_x64")["Window"]("", "", 1)["Window"]("Static", "xxx Setup is preparing the InstallShield Wizard, which will guide you through the program setup process.  Please wait.", 2)["WndCaption"] and use something shorter?



    Thanks
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    That code looks correct, assuming you have the proper loop built around the driver to increment your data record to the next checkpoint.



    As for shortening the NameMapping, this is what "Aliases" are for.  You can click and drag a NameMapping item into the Aliases pane and then reference the item by a shorter extension.


  • Oferv's avatar
    Oferv
    Super Contributor
    Thanks Robert,



    Is that o.k to use 

    //Move to the next record set  

      DDT["CurrentDriver"]["Next"]()

    in order to increment the next record?



    i created one xls with one sheet for each language and for each component i have specific line in the excel so i'm using 

    //Move to the next record set  

      DDT["CurrentDriver"]["Next"]()

    is that o.k?instead of a loop



    Thanks
  • Oferv's avatar
    Oferv
    Super Contributor
    that doesn't work

    NameMapping["Sys"]["Process"]("pdfcreator10enc_x64")["Window"]("", "", 1)["Window"]("Static", "xxx Setup is preparing the InstallShield Wizard, which will guide you through the program setup process.  Please wait.", 2)["WndCaption"] == DDT["CurrentDriver"]["Value"]("CheckPoint")) 



    when i'm running the Japanese installation tc is waiting for the pdfcreator10enc_x64 window but since the window name is now display in Japanese it will never find it therefore it's unable to compare it to the current Japanese record set .

    how can i solve that?



    thanks
  • Oferv's avatar
    Oferv
    Super Contributor
    so in english the WndCaption is xxx 1.0.1 - InstallShield Wizard

    and in Japanese is xxx 1.0.1用のInstallShield ウィザードへようこそ


  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Since WndCaption is one of the dynamic properties, then, of the object you are mapping, change the mapping parameters to use something other than WndCaption to identify the object.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    It may not be a single property but may be a combination of several that uniquely identify the component.  Without knowing the application, the component in question, etc., I cannot help with the specifics.  However, I have found that there is usually a way to do so.



    Something else you might want to consider in your mapping is taking a look at the "Required Children" feature of name mapping and, possibly, the "Conditional Mode" feature.  Both of those give additional capabilities to name mapping so it is not as dependant upon just the static properties of the object.



    For that matter, your WndCaption contains some common text.  You could edit your NameMapping to wildcard your WndCaption as "*InstallShield*" which, in combination with something like WndClass and some other paramters, will uniquely identify your component.