I am using the Popupwatcher to handle some expected Windows.
Because I need it more than one I create a separate class for this.
Code: Select all
public class UnexpectedWindowHandler
{
public UnexpectedWindowHandler()
{
PopupWatcher pw = new PopupWatcher();
StandardtestRepository repo = StandardtestRepository.Instance;
pw.Watch(repo.NichtFreigabefaehig, SpecialRelease);
pw.Watch(repo.DubletteUebernehmen,AddDuplicate);
pw.Start();
}
private static void SpecialRelease(Ranorex.Core.Repository.RepoItemInfo info, Ranorex.Core.Element element)
{
Orders.SpecialRelease();
}
private static void AddDuplicate(Ranorex.Core.Repository.RepoItemInfo info, Ranorex.Core.Element element)
{
Orders.RecentlyAddedArticle();
}
Code: Select all
private void Init()
{
// Your recording specific initialization code goes here.
UnexpectedWindowHandler uwh = new UnexpectedWindowHandler();
}
For example the method SpecialRelase has more than one action.
Code: Select all
public static void SpecialRelease()
{
repo.NichtFreigabefaehig.ButtonOK.Click("18;11");
repo.AuftragsabschlussDE.SonderfreigabeOhneReservierenF9.Click("231;7");
repo.AuftragsabschlussDE.Kundenabsprache.Click("227;10");
}
I hope you know what I mean and can help me.