Example #1
0
        public static void StartWinAppDriver()
        {
            if (_shouldStartLocalService)
            {
                // Anton(06.09.2018): maybe we can kill WinAppDriver every time
                if (ProcessProvider.IsProcessWithNameRunning("WinAppDriver") || ProcessProvider.IsPortBusy(_port))
                {
                    return;
                }

                string winAppDriverPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Windows Application Driver");
                if (!Directory.Exists(winAppDriverPath))
                {
                    throw new ArgumentException("Windows Application Driver is not installed on the machine. To use BELLATRIX Desktop libraries you need to install it first. You can download it from here: https://github.com/Microsoft/WinAppDriver/releases");
                }

                string winAppDriverExePath = Path.Combine(winAppDriverPath, "WinAppDriver.exe");
                _winAppDriverProcess = ProcessProvider.StartProcess(winAppDriverExePath, winAppDriverPath, $" {_ip} {_port}", true);
                ProcessProvider.WaitPortToGetBusy(_port);
            }
        }