public bool LaunchApplication(string appPath, string appTitle) { var desktop = this.GetDektopRoot(); desktop.PressKeysCombination(Keys.Windows, 'r'); IUiElementWrapper runner = null; int attempts = 0; while (runner == null && attempts < 15) { runner = this.GetApplicationRoot("Run"); } runner.SendKeys(appPath); runner.PressKey(Keys.Enter); IUiElementWrapper result = null; while (result == null && attempts < 15) { result = this.GetApplicationRoot(appTitle); } return(result != null); }
public Element(IUiElementWrapper uiInstance, Navigator navigator, ILogger logger, IElementFactory eFactory) { this.UiInstance = uiInstance ?? throw new ArgumentNullException(nameof(IUiElementWrapper)); this.navigator = navigator ?? throw new ArgumentNullException(nameof(Navigator)); this.logger = logger ?? throw new ArgumentNullException(nameof(ILogger)); this.elementFactory = eFactory; }
public MenuBar( IUiElementWrapper wrapper, Navigator navigator, IElementFactory eFactory, ILogger logger) : base(wrapper, navigator, logger, eFactory) { this.uiWrapper = wrapper; this.logger = logger; }
public FileMenu( IUiElementWrapper wrapper, Navigator navigator, IElementFactory eFactory, ILogger logger) : base(wrapper, navigator, logger, eFactory) { this.uiWrapper = wrapper; this.logger = logger; this.awaitHandler = navigator.AwaitService; }
public bool CloseApplication(string appTitle) { var desktop = this.GetDektopRoot(); desktop.PressKeysCombination(Keys.Windows, 'r'); IUiElementWrapper runner = null; int attempts = 0; while (runner == null && attempts < this.settings.TryAttemptsFindOrClose) { runner = this.GetApplicationRoot("Run"); } runner.SendKeys($"taskkill /IM notepad.exe /F"); runner.PressKey(Keys.Enter); return(true); }
public T CreateElement <T>(IUiElementWrapper wrapper, Navigator navigator, IElementFactory eFactory, ILogger logger) where T : Element { Type type = typeof(T); if (type == typeof(Element)) { return(new Element(wrapper, navigator, logger, eFactory) as T); } else if (type == typeof(MenuBar)) { return(new MenuBar(wrapper, navigator, eFactory, logger) as T); } else if (type == typeof(FileMenu)) { return(new FileMenu(wrapper, navigator, eFactory, logger) as T); } else if (type == typeof(EditMenu)) { return(new EditMenu(wrapper, navigator, eFactory, logger) as T); } else if (type == typeof(ViewMenu)) { return(new ViewMenu(wrapper, navigator, eFactory, logger) as T); } else if (type == typeof(TextEditor)) { return(new TextEditor(wrapper, navigator, eFactory, logger) as T); } else if (type == typeof(ButtonElement)) { return(new ButtonElement(wrapper, navigator, eFactory, logger) as T); } else { return(default);
public WindowsRootWindow(IUiElementWrapper wrapper, Navigator navigator, ILogger logger, IElementFactory eFactory) : base(wrapper, navigator, logger, eFactory) { this.logger = logger; }
public ButtonElement(IUiElementWrapper uiWrapper, Navigator navigator, IElementFactory eFactory, ILogger logger) : base(uiWrapper, navigator, logger, eFactory) { this.logger = logger; this.wrapper = uiWrapper; }