예제 #1
0
        public void Run(IEditorApplication context, IBehavior behavior)
        {
            _log = new Log(context, DriverIdent);

            try
            {
                _driverContext = new DriverContext(context, _log, DriverName, false);

                // enter your code which should be executed when starting the SCADA Editor Wizard

                _log.Message("begin test");

                _driverContext.Export(XmlSuffixBefore);

                if (_driverContext.OpenDriver(10))
                {
                    _driverContext.ModifyCommonProperties();
                    _driverContext.ModifyCOMProperties();

                    ModifyOptions();

                    _driverContext.CloseDriver();

                    _driverContext.Export(XmlSuffixAfter);
                    _driverContext.Import(XmlSuffixBefore);
                }

                _log.Message("end test");
            }
            catch (Exception ex)
            {
                _log.ExpectionMessage($"An exception has been thrown: {ex.Message}", ex);
                throw;
            }
        }
        //  public void CreateTopLevelCustomerDetails(string LineOfBusiness,string Band)
        public void CreateTopLevelCustomerDetails()
        {
            int srow = ConfigReader.srow;
            int erow = ConfigReader.erow;

            for (int i = srow; i <= erow; i++)
            {
                try
                {
                    //var autoIT=new AutoItX3();
                    //IE
                    System.Diagnostics.Process.Start(@"D:\Shell Framework\AutomationFramework -Nunit - Parallel\AutomationFramework\Autoitscript\HandleAuthenticationWindow.exe");
                    DriverContext.GetDriver <IWebDriver>().Navigate().GoToUrl("http://ws08r2/gfnlaunch");

                    //chrome
                    //  DriverContext.GetDriver<IWebDriver>().Navigate().GoToUrl("http://*****:*****@ws08r2/gfnlaunch");

                    //var driverHandles = DriverContext.GetDriver<IWebDriver>().WindowHandles;
                    //var test = autoIT.Winactive;
                    //SendKeys.Send(@"code\shwet");

                    //   DriverContext.GetDriver<IWebDriver>() = GetChromeDriver();


                    DriverContext.InitDriver(_browsertype);
                    var    autoIT = new AutoItX3();
                    string title  = DriverContext.GetDriver <IWebDriver>().Title;

                    string testmethodname = TestContext.CurrentContext.Test.Name;

                    LogHelper.WriteLog(ConfigReader.logFilePath, "****************************");

                    LogHelper.WriteLog(ConfigReader.logFilePath, "Executing Test Case-> " + testmethodname);

                    LogHelper.WriteLog(ConfigReader.logFilePath, "****************************");


                    Customer c = new Customer();
                    c.selectcolco(ConfigReader.GetColco);

                    string customerERP = c.CreateCustomerDetails(ConfigReader.GetColco, i);


                    DriverContext.CloseDriver();
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.Message);
                }
            }
        }
        public void ReSubmitFormwithMessage()
        {
            int srow = ConfigReader.srow;
            int erow = ConfigReader.erow;

            for (int i = srow; i <= erow; i++)
            {
                try
                {
                    DriverContext.InitDriver(_browsertype);
                    ContactUs c = new ContactUs();
                    c.FillFormwithMessage(i);
                    Thread.Sleep(5000);
                    DriverContext.CloseDriver();
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.Message);
                }
            }
        }