Exemplo n.º 1
0
        //[STAThread] //if need capture current window screen, must add [STAThread]
        //NonComVisibleBaseClass exception:
        //Actuall this diag is not considered as an exception, it only display when you debug the Auto UI program, if you build a release version for your program, it will run normally

        /*You can turn off the managed Debugging Assistant for the "NonComVisibleBaseClass" exception. In Visual Studio,
         *
         * 1. Navigate to Debug->Exceptions...
         * 2. Expand "Managed Debugging Assistants"
         * 3. Uncheck the NonComVisibleBaseClass Thrown option.
         * 4. Click [Ok]
         */
        //how to find control: please use getcontrolname method first
        static void Main(string[] args)
        {
            //EditOp.EditInput("Login", "3001", "training"); // edit control use id property, name is null
            //EditOp.EditInput("Login", "2000", "mercury");
            // ButtonOp.buttonClick("Login", "OK");
            // Utility.wait(10);
            // EditOp.EditInput("Flight Reservation", "", "111111");
            // ComboBoxOp.ComboBoxItemSelect("Flight Reservation", "1003", "Frankfurt");
            // ComboBoxOp.ComboBoxItemSelect("Flight Reservation", "2004", "Los Angeles");
            // ButtonOp.buttonClick("Flight Reservation", "FLIGHT");
            // ListItemOp.ListItemSelect("Flights Table", "20330");
            // ButtonOp.buttonClick("Flights Table", "OK");
            // EditOp.EditInput("Flight Reservation", "1014", "Ivan");
            // ButtonOp.buttonClick("Flight Reservation", "Insert Order");
            // ButtonOp.buttonClick("Flight Reservation", "6");


            //Console.WriteLine(ListItemOp.ListItemSelect("电话号码查询","ganww"));
            // Console.WriteLine(ListOP.SelectItemByCount("电话号码查询", "6", 0));
            //MenuOp.MenuClick("电话号码查询", "工具");
            MenuOp.MenuItemClick("电话号码查询", "工具", "选项");
            RadioOp.RadioSelect("查询设置", "和");
            //Console.WriteLine(EditOp.Exsit("Flight Reservation","Class:"));
            Console.ReadLine();
        }
Exemplo n.º 2
0
        public void FindFlight(BrowserOp browser)
        {
            RadioOp.RadioSelect(browser, "tripType", "oneway");

            ComboBoxOp.ComboBoxItemSelect(browser, "passCount", "3");

            ComboBoxOp.ComboBoxItemSelect(browser, "fromPort", "London");

            ComboBoxOp.ComboBoxItemSelect(browser, "fromMonth", "10");

            ComboBoxOp.ComboBoxItemSelect(browser, "fromDay", "19");

            ComboBoxOp.ComboBoxItemSelect(browser, "toPort", "Paris");

            RadioOp.RadioSelect(browser, "servClass", "Business");

            ComboBoxOp.ComboBoxItemSelect(browser, "airline", "Unified Airlines");

            ButtonOp.buttonClick(browser, "findFlights");

            RadioOp.RadioSelect(browser, "outFlight", "Blue Skies Airlines$361$271$7:10");


            ButtonOp.buttonClick(browser, "reserveFlights");
        }
Exemplo n.º 3
0
 public static void OdomainAddNotification(BrowserOp browser)
 {
     ButtonOp.buttonClick(browser, "//a[1]/img");
     ButtonOp.buttonClick(browser, "//tr[@id='menu21']/td/a/img");
     browser.SwitchFrame("cfrm");
     ButtonOp.buttonClick(browser, "//a[@id='profileNoticeAdd']/img");
     EditOp.EditInput(browser, "noticeName", "test");
     RadioOp.RadioSelect(browser, "remindUser", "true");
     EditOp.EditInput(browser, "userNotice", "ivangeng");
     ButtonOp.buttonClick(browser, "imageField");
     Console.WriteLine(browser.AssertStringinSourceCode("成功创建"));
 }
Exemplo n.º 4
0
 public string FindFlight()
 {
     while (EditOp.Exsit("Flight Reservation", "__/__/__") == false)
     {
         Utility.wait(2);
     }
     EditOp.EditInput("Flight Reservation", "__/__/__", "11/11/11");
     ComboBoxOp.ComboBoxItemSelect("Flight Reservation", "1003", "Frankfurt");
     ComboBoxOp.ComboBoxItemSelect("Flight Reservation", "2004", "Los Angeles");
     ButtonOp.buttonClick("Flight Reservation", "FLIGHT");
     ListItemOp.ListItemSelect("Flights Table", "20330");
     ButtonOp.buttonClick("Flights Table", "OK");
     EditOp.EditInput("Flight Reservation", "1014", "Ivan");
     EditOp.EditInput("Flight Reservation", "1029", "3");
     RadioOp.RadioSelect("Flight Reservation", "Business");
     ButtonOp.buttonClick("Flight Reservation", "Insert Order");
     Utility.wait(10);
     return(EditOp.EditOutput("Flight Reservation", "1016"));
 }
Exemplo n.º 5
0
        public void FlexTest()
        {
            string windowname = "Internet Explorer";

            // string windowname = "Mozilla Firefox";
            Utility.wait(10);

            Console.WriteLine(EditOp.EditInput(windowname, "Form Heading Text Input:", "beijing"));

            Console.WriteLine(EditOp.EditInput(windowname, "Form Heading Text Area:", "ivan"));

            CheckboxOp.CheckBoxOn(windowname, "Form Heading Checkboxes: Checkbox 1");

            CheckboxOp.CheckBoxOn(windowname, "Form Heading Checkboxes: Checkbox 2");

            RadioOp.RadioSelect(windowname, "Form Heading Radio Group: Radio Button 2 2 of 2");

            ComboBoxOp.ComboBoxItemSelect(windowname, "Form Heading Combo Box:", "Item 1");


            //Form Heading Button Form Heading Button
            //FlashSelenium.FlashSelenium flex = new FlashSelenium.FlashSelenium(
            // Console.WriteLine(ButtonOp.buttonClick(windowname, "Form Heading Button"));
            //  KeyboardOp.sendKey(" ");
            // Utility.wait(2);
            //ButtonOp.buttonClick("Alert", "OK");



            EditOp.EditInput(windowname, "Text Input T1: Text Input T1:", "10025");
            EditOp.EditInput(windowname, "Text Input A1: Text Input A1:", "fadsfdasfa");

            //TabOp.TabSwitch(windowname, "", "Tab 2");

            Console.WriteLine(TabOp.TabSwitch(windowname, "Accordion Pane 3"));
//Console.WriteLine(TabOp.TabSwitch(windowname, "Accordion Pane 2"));
            //Utility.wait(5);
        }