locked
How to share a common window? RRS feed

  • Question

  • we have a multiple UImaps applications where one dialog is independent with each of them. I mean it can prompt in each of page.

    for example:

    i have UImapA, uIMAPB, one dialog named dialogC does not depend on any of the classes in them, can prompt when running any test in A or B. How can i share this dialog? do i have to capture for each of the UIMAP?

    BTW, this dialog is an error message dialog, can show up anytime if there is any issue. How can i close it at anytime it shows? Does UITest has a method called like whenever...?

    Thank you,

    Tuesday, October 12, 2010 7:26 PM

Answers

All replies

  • You can handcode such scenarios and keep it in your utility methods and call from the test methods wherever you expect them to appear.

    Particularly, when you are sure of its properties like Title, you could take this way.


    Please mark this post as answer if this answers your question
    Tuesday, October 12, 2010 7:57 PM
    Moderator
  • thank you very much. One other question.How can i suppress a window whenever it shows up like error message dialog? this dialog can prompt anytime.

     

    Thank you

    Tuesday, October 12, 2010 8:04 PM
  • Please refer this thread - http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/d7cc59ca-b968-4721-ae79-a966b4d81175

    If you know the searchproperties of the dialog, eg. Title, then you should specify the search properties while searching for such windows. That will be more performant and accurate. In the code in the referred thread, you could add - win.SearchProperties.Add(WinWindow.PropertyNames.Name, "Error"); - where "Error" is the title of the dialog.


    Please mark this post as answer if this answers your question
    Tuesday, October 12, 2010 8:36 PM
    Moderator
  • Thank you. Where should i put this code? because it could prompt anytime,anywhere.
    Tuesday, October 12, 2010 9:01 PM