Forum Discussion

dkasirajan's avatar
dkasirajan
Contributor
7 years ago
Solved

How to name map for common objects but has different parent - for reusablity

We have two desktop application , but its child window / pop up window  have same controls and functinality. 

I want to reuse this controls and scripts  by having common name mapping. 

Only Parents are different how to create alias which can be used in both application .

Here by i have attached name mapping. Is there any way. please help me . 

 

 

Thanks,

Devaki

  • The problem is, as I mention above, that you are not using what you actually have mapped.  

     

    Replace 

     

    Aliases.Revera_AnalysisMain_DiagnosticUtility.DependentSettingsDlg.rcpButtonProceed

    with 

     

     

    Aliases.Revera_OperatorInterface.DependentSettingsDlg.rcpButtonProceed

    Your mapping will handle if it's coming up as a different process due to the conditional mapping you're using.  You can use this way of referencing no matter which of the two processes it is.

     

16 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    While the documentation mentions that Extended Find is typically used for web applications, it works for desktop apps as well.  Basically, check that flag on your mapped popup and then drag it to the application level (or associated level).  This will find the child window no matter what the parent object is.

    • dkasirajan's avatar
      dkasirajan
      Contributor

      I tried this one. i am able to map the objects . but while recording / scripting, it is not finding objects.

      Thanks . I will try

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        It's unclear which option you tried.  Could you clarify?

         

        Also, successful mapping is half the problem.  You noted that you are also having problems identifying the object while the test is running.  This could be something that is not a mapping problem but a problem in timing.  Make sure you have appropriate wait methods and other such things in place to make sure you're giving sufficient time for the popup to display before you proceed.

    • dkasirajan's avatar
      dkasirajan
      Contributor

      To RoberMartin,

      Thanks for the reply. I tried By moving objects under root Sys. 

       

      then not able to record and play. because it creates object under Sys. <Application Name>,SelectSettingdialog

      eventhough i mapped it like  Sys.SelectSettingdialog.

       

      but i tried adding steps by Onscreenaction - but while running it takes very long time and has object recognition error.

       

      I have two different application which has same pop up dialog and functionality.  

      like below OperatorInterface  & AnalysisMain_DiagnosticUtility are different application .

      To Shankar:

      I tried with Conditional Mode for name mapping of SelectSettingsDialog. But i am not sure how to represent parent here.

       

      Aliases.OperatorInterface.SelectSettingsDialog
      Aliases.AnalysisMain_DiagnosticUtility.SelectSettingsDialog

       

      Thanks for the response.

      Devaki

      • joseph_michaud's avatar
        joseph_michaud
        Moderator

        Re Conditional Mapping:  It is not the criteria for SelectSettingdialog that you change.  Rather it is the criteria for its *parent* that you change.  So rather than having a namemap like this:

         

        Revera_AnalysisMain_DiagnosticUtility

        ->SelectSettingsDialog

        Revera_OperatorInterface

        ->SelectSettingsDialog

         

        You'd have a namemap like this:

         

        Revera_Common

        ->SelectSettingsDialog

         

        The namemap criteria for Revera_Common might look something like this:

         

        WndCaption = "DiagnosticUtility" OR WndCaption = "OperatorInterface"

         

         

  • shankar_r's avatar
    shankar_r
    Community Hero

    Hi,

     

    So, you have one set of objects which can be under different parents. If this is the case you can try something like below,

     

    • Grab the difference between two parents.

    For Ex:

    Parent1 has the ObjectIdetifier property as mainpage

    Parent2 has the ObjectIdetifier property as submainpage.

    • Then you can your objects under one parent and modify the ObjectIdentifier property like below,

    ObjectIdentifier as *mainpage