Exemple #1
0
        public void TestCMCCTestPortal(BrowserOp browser)
        {
            XMLUtility xml           = new XMLUtility("./TestPortal.xml");
            string     userName      = xml.readNodeValue("UserName");
            string     pwd           = xml.readNodeValue("PWD");
            string     manufacturer  = xml.readNodeValue("manufacturer");
            string     model         = xml.readNodeValue("model");
            string     packageType   = xml.readNodeValue("packageType");
            string     packageStatus = xml.readNodeValue("packageStatus");

            EditOp.EditInput(browser, "mobile", userName);
            EditOp.EditInput(browser, "password", pwd);
            ButtonOp.buttonClick(browser, "submit");
            Utility.wait(5);
            HyperLinkOp.LinkClick(browser, "包管理");
            //ButtonOp.buttonClick(browser, "A16");
            ButtonOp.buttonClick(browser, "//input[@id='A16' and @value='固件更新包管理']");
            Utility.wait(1);
            ComboBoxOp.ComboBoxItemSelect(browser, "manufacturer", manufacturer);
            Utility.wait(1);
            ComboBoxOp.ComboBoxItemSelect(browser, "model_name", model);
            Utility.wait(1);
            ComboBoxOp.ComboBoxItemSelect(browser, "packageType", packageType);
            Utility.wait(1);
            ComboBoxOp.ComboBoxItemSelect(browser, "packageStatus", packageStatus);

            ButtonOp.buttonClick(browser, "submit2");
        }
        static void GoogleLogin(BrowserOp browser, string userName, string PWD)
        {
            HyperLinkOp.LinkClick(browser, "登录");
            EditOp.EditInput(browser, "Email", userName);
            EditOp.EditInput(browser, "Passwd", PWD);
            ButtonOp.buttonClick(browser, "PersistentCookie");
            ButtonOp.buttonClick(browser, "signIn");

            if (browser.AssertStringinSourceCode("您输入的用户名或密码不正确"))
            {
                Console.WriteLine("Login Failed");
            }
            else if (browser.AssertStringinSourceCode("请输入密码"))
            {
                MessageBox.Show("please input your password");
            }
            else if (browser.AssertStringinSourceCode("请输入电子邮件地址"))
            {
                Console.WriteLine("please input your account");
            }
            else if (browser.AssertStringinSourceCode("输入上图中显示的字母"))
            {
                Console.WriteLine("My God!");
            }
        }
Exemple #3
0
 static void TestSelfCare(BrowserOp browser)
 {
     EditOp.EditInput(browser, "mobile", "root");
     EditOp.EditInput(browser, "password", "111111");
     ButtonOp.buttonClick(browser, "submit");
     Utility.wait(2);
     HyperLinkOp.LinkClick(browser, "客户问题");
     Utility.wait(5);
     ButtonOp.buttonClick(browser, "start");
     Utility.wait(5);
     ButtonOp.buttonClick(browser, "//div[3]/table/tbody/tr[1]/td[4]");
 }
Exemple #4
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("成功创建"));
 }
Exemple #5
0
 static void SimulatorInit(string Man, string Model, string Version, string ID, string phoneNumber)
 {
     ButtonOp.buttonClick("mProveDM Simulator", "Setting");
     EditOp.EditInput("mProveDM Simulator", "Man:", Man);
     EditOp.EditInput("mProveDM Simulator", "Model:", Model);
     EditOp.EditInput("mProveDM Simulator", "Version:", Version);
     EditOp.EditInput("mProveDM Simulator", "DeviceID:", ID);
     EditOp.EditInput("mProveDM Simulator", "PhoneNum:", phoneNumber);
     ButtonOp.buttonClick("mProveDM Simulator", "Apply");
     ButtonOp.buttonClick("mProveDM Simulator", "OK");
     ButtonOp.buttonClick("mProveDM Log Dialog", "Clear");
     // System.Windows.Point p = new System.Windows.Point(839, 471);
     // CustomControl.buttonClick("mProveDM Simulator", p);
 }
Exemple #6
0
 public static void FindFlight()
 {
     EditOp.EditInput("Flight Reservation", "__/__/__", "11/11/11");
     Utility.wait(2);
     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(EditOp.Exsit("Flight Reservation", "Class:"));
 }
Exemple #7
0
 static void TestPortalAddUser(BrowserOp browser, string userName, string PWD)
 {
     HyperLinkOp.LinkClick(browser, "用户信息管理");
     ButtonOp.buttonClick(browser, "A13");
     ButtonOp.buttonClick(browser, "//input[@value='添加包测试用户']");
     EditOp.EditInput(browser, "username", userName);
     EditOp.EditInput(browser, "password", PWD);
     EditOp.EditInput(browser, "confirmpassword", PWD);
     ButtonOp.buttonClick(browser, "Submit");
     Utility.wait(5);
     if (browser.AssertStringinSourceCode("您添加的用户已经存在系统中"))
     {
         Console.WriteLine("User existed!");
     }
     else
     {
         Console.WriteLine("Add success");
     }
 }
Exemple #8
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"));
 }
Exemple #9
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);
        }
Exemple #10
0
 static void TestNet()
 {
     Console.WriteLine(EditOp.GetEditName("Form1"));
     Console.WriteLine(ButtonOp.GetButtonName("Form1"));
 }
Exemple #11
0
 public void Login(BrowserOp browser, string userName, string PWD)
 {
     EditOp.EditInput(browser, "userName", userName);
     EditOp.EditInput(browser, "password", PWD);
     ButtonOp.buttonClick(browser, "login");
 }
 private void copyToolStripMenuItem_Click(object sender, EventArgs e) {
   lastOp = EditOp.CopySubtree;
   copySubtree();
 }
Exemple #13
0
 public void Login(string userName, string PWD)
 {
     EditOp.EditInput("Login", "3001", userName);
     EditOp.EditInput("Login", "2000", PWD);
     ButtonOp.buttonClick("Login", "OK");
 }
 private void copyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     lastOp = EditOp.CopySubtree;
     copySubtree();
 }
Exemple #15
0
 static void TestPortalLogin(BrowserOp browser, string userName, string PWD)
 {
     EditOp.EditInput(browser, "msisdn", userName);
     EditOp.EditInput(browser, "pwd", PWD);
     ButtonOp.buttonClick(browser, "submit");
 }
Exemple #16
0
        private static EditOp[] EditOpsFromCostMatrix <T>(int len1, T[] c1, int p1, int o1,
                                                          int len2, T[] c2, int p2, int o2,
                                                          int[] matrix)
            where T : IEquatable <T>
        {
            int i, j, pos;

            int ptr;

            EditOp[] ops;

            int dir = 0;

            pos = matrix[len1 * len2 - 1];

            ops = new EditOp[pos];

            i = len1 - 1;
            j = len2 - 1;

            ptr = len1 * len2 - 1;

            while (i > 0 || j > 0)
            {
                if (dir < 0 && j != 0 && matrix[ptr] == matrix[ptr - 1] + 1)
                {
                    EditOp eop = new EditOp();

                    pos--;
                    ops[pos]      = eop;
                    eop.EditType  = EditType.INSERT;
                    eop.SourcePos = i + o1;
                    eop.DestPos   = --j + o2;
                    ptr--;

                    continue;
                }

                if (dir > 0 && i != 0 && matrix[ptr] == matrix[ptr - len2] + 1)
                {
                    EditOp eop = new EditOp();

                    pos--;
                    ops[pos]      = eop;
                    eop.EditType  = EditType.DELETE;
                    eop.SourcePos = --i + o1;
                    eop.DestPos   = j + o2;
                    ptr          -= len2;

                    continue;
                }

                if (i != 0 && j != 0 && matrix[ptr] == matrix[ptr - len2 - 1] &&
                    c1[p1 + i - 1].Equals(c2[p2 + j - 1]))
                {
                    i--;
                    j--;
                    ptr -= len2 + 1;
                    dir  = 0;

                    continue;
                }

                if (i != 0 && j != 0 && matrix[ptr] == matrix[ptr - len2 - 1] + 1)
                {
                    pos--;

                    EditOp eop = new EditOp();
                    ops[pos] = eop;

                    eop.EditType  = EditType.REPLACE;
                    eop.SourcePos = --i + o1;
                    eop.DestPos   = --j + o2;

                    ptr -= len2 + 1;
                    dir  = 0;
                    continue;
                }

                if (dir == 0 && j != 0 && matrix[ptr] == matrix[ptr - 1] + 1)
                {
                    pos--;
                    EditOp eop = new EditOp();
                    ops[pos]      = eop;
                    eop.EditType  = EditType.INSERT;
                    eop.SourcePos = i + o1;
                    eop.DestPos   = --j + o2;
                    ptr--;
                    dir = -1;

                    continue;
                }

                if (dir == 0 && i != 0 && matrix[ptr] == matrix[ptr - len2] + 1)
                {
                    pos--;
                    EditOp eop = new EditOp();
                    ops[pos] = eop;

                    eop.EditType  = EditType.DELETE;
                    eop.SourcePos = --i + o1;
                    eop.DestPos   = j + o2;
                    ptr          -= len2;
                    dir           = 1;
                    continue;
                }

                throw new InvalidOperationException("Cant calculate edit op");
            }

            return(ops);
        }
Exemple #17
0
 static void TestVB()
 {
     //Console.WriteLine(EditOp.GetEditName("电话号码查询"));
     Console.WriteLine(EditOp.EditInput("电话号码查询", "11", "123"));
     ButtonOp.buttonClick("电话号码查询", "查询");
 }