Forum Discussion

pmallela2's avatar
pmallela2
Contributor
9 years ago

how to handel the multiple instances of same application,in name mapping

how to handel the multiple instances of same application,in name mapping

1 Reply

  • Manfred_F's avatar
    Manfred_F
    Regular Contributor

    hi pmallela2,

    the alias mechanism is really fine if You have got tests with single, unique UI elements.

     

    If You need to be more flexible, You still can use aliases: in case You want to use one dialog type for different elements, this can also easily be done e.g. by including an asterisk in the alias condition for the dialog caption, masking the element name. BUT: You can only use one single dialog instance, if You open a second one, the alias will probably point to the first one. Dealing with multiple application instances should behave the same way.

     

    To deal with multiple instances, I use a wrapper mechanism described in

    http://community.smartbear.com/t5/Functional-Web-Testing/If-I-had-it-all-to-do-over-again/td-p/97328/highlight/true/page/2

    How to get access to a second instance of a control? I use the alias to return me one control of the desired kind. Then I iterate the siblings until I've got the desired <new> one, and build my wrapper around it.

    All of this is done by a dedicated alias control class. It returns me a new available control and also can deal with the situation that the basic alias may stop existing.

     

    Regards,

    Manfred