Forum Discussion

sonali_suhani's avatar
sonali_suhani
Occasional Contributor
12 years ago

Automate Different Editions Of a Window Application n Single Script

I'm working on a self developed windows application

I've automated the application usingthe VbScript

Now i want to run the same script for its next edition.

Is it possible to do so ?

Coz the windows are exactly same in both the editions just the name mapping path has one thing diffreing

ie

in the first edition

i have


Sys.Process("OpKey 2.0.2.2836").VCLObject("frmDesign_15").VCLObject("Back")


 

 and in the next one i have,


Sys.Process("OpKey 2.1.0.3030").VCLObject("frmDesign_13").VCLObject("Back")






Is it possibl;e to do so ?

Please help

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Sonali,


     


    That's difficult to answer yes or no for sure. It depends on your existing test and the way the GUI of the tested app was changed. Based on your example, I see that the names of some objects were changed:


    frmDesign_15  - > frmDesign_13


     


    If you use an object's name to map the object, the test will fail. In any way, you can give it a try and modify the current test if needed (it's better than creating a new test from scratch).

  • sonali_suhani's avatar
    sonali_suhani
    Occasional Contributor
    Hello Tanya,



    I by mistake posted the wrong object's name .

    it is

    Sys.Process("OpKey 2.0.2.2836").VCLObject("frmDesign_15").VCLObject("Back")



    and 


    Sys.Process("OpKey 2.1.0.3030").VCLObject("frmDesign_15").VCLObject("Back")



    can regular expression work in this case ?

    as in like i'm trying to generate a regular expression for "OpKey 2.0.2.2836"

    so as it can work on any edition.

    But i'm having troubles generating the regular expression in VbScript.

    Can i get some help on this ?
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Sonali,


     


    If only the process name was changed, try the following code:


    Sys.Process("OpKey*").VCLObject("frmDesign_15").VCLObject("Back")


     

  • sonali_suhani's avatar
    sonali_suhani
    Occasional Contributor
    Hey Tanya,



    Thanks for a quick reply.I've already tried  using both

    Opkey 2.* and Opkey*

     none of them work. But  thanks to almighty, I came up with a new approach and by chance it worked.! 

    I took the list of processes from task manager and retrieved the Opkey Version from it and inserted it into the path.

    :)



    Thanks for your support and help :)
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Sonali,


     


    That's kind of tricky approach :)


     


    Refer to us if you decide to continue investigating why * doesn't work for you.


     

  • sonali_suhani's avatar
    sonali_suhani
    Occasional Contributor

    Hey Guys ,

    I'm again Facing issues with the same thing

    I have two objects, their full name is as below:





    Sys.Process("OpKey").WinFormsObject("Workbench").WinFormsObject("NavAndTabView").WinFormsObject("DockPanelProjectExplorer").WinFormsObject("DockPanel1_Container").WinFormsObject("OpKeyProjectNav").WinFormsObject("NavBarControl1").WinFormsObject("NavBarGroupControlContainerWrapper", "", 1).WinFormsObject("NavBarGroupControlContainer2").WinFormsObject("ORExplorer").WinFormsObject("BarDockControl", "", 6).WinFormsObject("DockedBarControl", "")






    Sys.Process("OpKey").WinFormsObject("Workbench").WinFormsObject("NavAndTabView").WinFormsObject("DockPanelProjectExplorer").WinFormsObject("DockPanel1_Container").WinFormsObject("OpKeyProjectNav").WinFormsObject("NavBarControl1").WinFormsObject("NavBarGroupControlContainerWrapper", "", 3).WinFormsObject("NavBarGroupControlContainer3").WinFormsObject("DR_Explorer").WinFormsObject("BarDockControl", "", 5).WinFormsObject("DockedBarControl", "")



    now i want to make it work for all of them . these are just two just as the above matter , i want to make this script global for every one so that i don't have tpo strat working again from scratch .



    please suggest me a way i can do it .

    Thanks