Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            IAutomation at = new Automation(new ExcelFileParser(), new ExcelReporter(new ExcelFileParser()),
                @"E:\demo_new\dotnetabt\codeduiabt\sample");
            UIAActionManager am = new UIAActionManager(at);

            try
            {
                Script startScript = new Script(at.Parser.NewInstance);
                startScript.FileName = "Script2.xls";

                Data data = new Data(at.Parser.NewInstance);
                data.FileName = "DataSet1.xls";

                at.Name = "Regression 1";
                at.Speed = 10;
                at.Data = data;
                at.StartScript = startScript;
                at.Start();

                at.Paused += at_Paused;
                at.Resumed += at_Resumed;
                at.Interupted += at_Interupted;
                at.Ended += at_Ended;
                at.ActionPerforming += at_ActionPerforming;

                //System.Threading.Thread.Sleep(3000);
                //at.Pause();

                //System.Threading.Thread.Sleep(10000);
                //at.Resume();

                //System.Threading.Thread.Sleep(3000);
                //at.Interupt();
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.Message);
            }
            finally
            {
                //at.Interupt();
                //Console.ReadLine();
            }

            //Automation at = new Automation(new ExcelFileParser(), new ExcelReporter(), @"D:\codes\dotnetabt\seleniumabt\sample");
            //SeleniumActionManager am = new SeleniumActionManager(at, SeleniumActionManager.Browser.Chrome);

            //Script startScript = new Script(at.Parser.NewInstance);
            //startScript.FileName = "Script.xls";

            //at.Scripts.Push(startScript);
            //at.Start();
        }
Ejemplo n.º 2
0
        public FormViewer()
        {
            InitializeComponent();

            IAutomation automation = new Automation(new ExcelFileParser(), new ExcelReporter(new ExcelFileParser()),
                @"E:\demo_new\dotnetabt\codeduiabt\sample");
            UIAActionManager actionManager = new UIAActionManager(automation);
            actionManager.WaitTime = new TimeSpan(0, 0, 1);

            IInterface iff = new Interface(automation.Parser.NewInstance);
            iff.FileName = "Calculator.xls";

            windowsViewer1.ActionManager = actionManager;
            windowsViewer1.CurrentInterface = iff;
            windowsViewer1.WindowsRefreshed += windowsViewer1_WindowsRefreshed;
            propertiesViewer1.CurrentInterface = iff;
        }
Ejemplo n.º 3
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            Close();
            main m = new main();
            //string path = m.CurrentProjectPath;

            CurrenrtAutomation = new Automation(new ExcelFileParser(), new ExcelReporter(new ExcelFileParser()),
               CurrentProjectPath);
            UIAActionManager am = new UIAActionManager(CurrenrtAutomation);

            try
            {
                Script startScript = new Script(CurrenrtAutomation.Parser.NewInstance);
                startScript.FileName = _txtScript.Text;
                string dataset = _cboData.SelectedItem.ToString();
                if (dataset != @"[None]")
                {
                    Data data = new Data(CurrenrtAutomation.Parser.NewInstance);
                    data.FileName = dataset;
                    CurrenrtAutomation.Data = data;

                }

                CurrenrtAutomation.Name = "Regression 1";
                CurrenrtAutomation.Speed = 10;
                CurrenrtAutomation.StartScript = startScript;
                CurrenrtAutomation.Start();

                //CurrenrtAutomation.Paused += at_Paused;
                //CurrenrtAutomation.Resumed += at_Resumed;
                //CurrenrtAutomation.Interupted += at_Interupted;
                //CurrenrtAutomation.Ended += at_Ended;
                //CurrenrtAutomation.ActionPerforming += at_ActionPerforming;

                //System.Threading.Thread.Sleep(3000);
                //at.Pause();

                //System.Threading.Thread.Sleep(10000);
                //at.Resume();

                //System.Threading.Thread.Sleep(3000);
                //at.Interupt();
            }
            catch (Exception x)
            {
                System.Windows.Forms.MessageBox.Show(x.Message);
            }
            finally
            {
                //at.Interupt();
                //Console.ReadLine();
            }

            //Automation at = new Automation(new ExcelFileParser(), new ExcelReporter(), @"D:\codes\dotnetabt\seleniumabt\sample");
            //SeleniumActionManager am = new SeleniumActionManager(at, SeleniumActionManager.Browser.Chrome);

            //Script startScript = new Script(at.Parser.NewInstance);
            //startScript.FileName = "Script.xls";

            //at.Scripts.Push(startScript);
            //at.Start();
        }