public void CheckStartingOfAServiceWithNonDefaultArguments()
        {
            OptionCollector    args    = new OptionCollector().AddArguments(GeneralOptionList.LogNoColors());
            AppiumLocalService service = new AppiumServiceBuilder().UsingPort(4000).WithArguments(args).Build();

            try
            {
                service.Start();
                Assert.IsTrue(service.IsRunning);
            }
            finally
            {
                service.Dispose();
            }
        }
        public void CheckStartingOfTheServiceDefinedExternallyWithNonDefaultArguments()
        {
            OptionCollector    args    = new OptionCollector().AddArguments(GeneralOptionList.LogNoColors());
            AppiumLocalService service = new AppiumServiceBuilder().WithAppiumJS(new FileInfo(PathToCustomizedAppiumJS)).
                                         UsingPort(4000).WithArguments(args).Build();

            try
            {
                service.Start();
                Assert.IsTrue(service.IsRunning);
            }
            finally
            {
                service.Dispose();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Function Name :- FnStartAppiumServer
        /// Created By :- Pankaj Kumar
        /// Date of Creation :- 11-Apr-2020
        /// </summary>
        public bool FnStartAppiumServer()
        {
            bool blnStatus = true;

            try
            {
                OptionCollector args = new OptionCollector().AddArguments(GeneralOptionList.LogNoColors());
                Environment.SetEnvironmentVariable(AppiumServiceConstants.NodeBinaryPath, objConfig.NodeBinaryPath);
                Environment.SetEnvironmentVariable(AppiumServiceConstants.AppiumBinaryPath, objConfig.AppiumBinaryPath);
                service = new AppiumServiceBuilder().UsingPort(4723).WithArguments(args).Build();
                service.Start();
                Console.WriteLine("Appium Server Started at ==> " + service.ServiceUrl);
            }
            catch (Exception e)
            {
                blnStatus = false;
                Console.WriteLine(e.StackTrace);
            }
            return(blnStatus);
        }