Ejemplo n.º 1
0
    private void WorkSteps()
    {
        errorCnt = 0;
        selenium = new AdvSeleniumAPIv2();

        selenium.StartupServer("http://" + textBox1.Text);
        System.Threading.Thread.Sleep(1000);

        selenium.Type("id=ACT0", "root");
        selenium.Type("id=PWD0", "00000000");
        selenium.Click("id=APY0");
        selenium.WaitForPageToLoad("30000");
        PrintStep();
        //
        PrintTitle("Check Logger Query");
        selenium.Click("id=advancedFunction");
        selenium.Click("id=dataLog");
        selenium.Click("link=Local Data Query");
        selenium.Click("id=inpMAC");
        selenium.Select("css=div.col-md-5 > #selTmF", "label=Local Date and Time(GMT)");
        selenium.Select("id=selFltr", "label=Amount of Latest Data");
        selenium.Click("id=btnQuery");
        selenium.Click("id=btnClear");
        selenium.Click("id=btnCommonConfirm");
        selenium.Click("link=System Data Query");
        selenium.Click("css=#collapseSysFormatConfig > div.form-group > div.col-md-3 > div.checkbox > label > #inpMAC");
        selenium.Select("css=#collapseSysFormatConfig > div.form-group > div.col-md-5 > #selTmF", "label=Local Date and Time(GMT)");
        selenium.Select("css=#collapseSysModeConfig > div.form-group > div.col-md-9 > #selFltr", "label=Amount of Latest Data");
        selenium.Click("css=#panelSystemLogViewer > div.panel-footer.clearfix > center > div.btn-group > #btnQuery");
        selenium.Click("css=#panelSystemLogViewer > div.panel-footer.clearfix > center > div.btn-group > #btnClear");
        selenium.Click("id=btnCommonConfirm");
        PrintStep();
        selenium.Close();
    }
Ejemplo n.º 2
0
    private void WorkSteps()
    {
        errorCnt = 0;
        selenium = new AdvSeleniumAPIv2();

        selenium.StartupServer("http://" + textBox1.Text);
        System.Threading.Thread.Sleep(1000);

        selenium.Type("id=ACT0", "root");
        selenium.Type("id=PWD0", "00000000");
        selenium.Click("id=APY0");
        selenium.WaitForPageToLoad("30000");
        PrintStep();
        //
        PrintTitle("Check Logger Config");
        selenium.Click("id=advancedFunction");
        selenium.Click("id=dataLog");
        selenium.Click("link=Logger Configuration");
        selenium.Click("id=memDEn");
        selenium.Click("id=memSEn");
        selenium.Click("//div[@id='panelLoggerConfig']/div/form/div[2]/div/div/div/div/label/span[2]");

        selenium.Click("//div[@id='panelLoggerConfig']/div/form/div[2]/div/div/div/div/label/span");
        selenium.Click("id=cloudEn");
        selenium.Click("css=#cloudUploadSetting > div.form-group.row > div.col-lg-12 > div.col-sm-10 > div.input-group > div.SliderSwitch > label.SliderSwitch-label > span.SliderSwitch-inner");
        selenium.Select("id=logFn", "label=YYYYMMDD");
        selenium.Select("id=logTmF", "label=Local Date and Time(GMT)");
        selenium.Select("id=selDEn", "label=Item Periodic Interval mode");
        selenium.Type("id=inpDItm", "10000");
        selenium.Type("id=inpDTag", "123456789012345678901234567890123456789012345678901234567890ABC123456789012345678901234567890123456789012345678901234567890ABC1");
        selenium.Select("id=selSEn", "label=Item Periodic Interval mode");
        selenium.Type("id=inpSItm", "10000");
        selenium.Type("id=inpSTag", "123456789012345678901234567890123456789012345678901234567890ABC123456789012345678901234567890123456789012345678901234567890ABC1");
        selenium.Click("css=#push_output > div.form-group.row > div.col-lg-12 > div.col-sm-10 > div.input-group > div.SliderSwitch > label.SliderSwitch-label > span.SliderSwitch-switch");
        selenium.Click("//span[@id='push_output']/div[2]/div/div/div/div/label/span");
        selenium.Click("id=logMAC");
        selenium.Select("id=selTmF", "label=Local Date and Time(GMT)");
        selenium.Click("id=btnLoggerConfigSubmit");
        PrintStep();
        //
        selenium.Click("id=memDEn");
        selenium.Click("id=memSEn");
        selenium.Select("id=logFn", "label=YYYYMMDDHHMMSS");
        selenium.Select("id=logTmF", "label=Coordinated Universal Time(UTC)");
        selenium.Select("id=selDEn", "label=Time Periodic Interval mode");
        selenium.Type("id=inpDTim", "864000");
        selenium.Type("id=inpDTag", "123456789012345678901234567890123456789012345678901234567890ABC123456789012345678901234567890123456789012345678901234567890ABC1");
        selenium.Select("id=selSEn", "label=Time Periodic Interval mode");
        selenium.Type("id=inpSTim", "864000");
        selenium.Type("id=inpSTag", "123456789012345678901234567890123456789012345678901234567890ABC123456789012345678901234567890123456789012345678901234567890ABC1");
        selenium.Click("id=logMAC");
        selenium.Click("id=logTIM");
        selenium.Click("id=btnLoggerConfigSubmit");
        PrintStep();
        selenium.Close();

        //
        eStatus(this, new StatusEventArgs(iStatus.Completion));
        eResult(this, new ResultEventArgs(iResult.Pass));
    }
Ejemplo n.º 3
0
    private void WorkSteps()
    {
        errorCnt = 0;
        selenium = new AdvSeleniumAPIv2();

        selenium.StartupServer("http://" + textBox1.Text);
        System.Threading.Thread.Sleep(1000);

        selenium.Type("id=ACT0", "root");
        selenium.Type("id=PWD0", "00000000");
        selenium.Click("id=APY0");
        selenium.WaitForPageToLoad("30000");
        PrintStep();
        //
        PrintTitle("Check Aliyun OSS items");
        selenium.Click("id=configuration");
        selenium.Click("link=Cloud");
        selenium.Select("id=selCloud", "label=  Aliyun OSS");
        selenium.Type("id=logNm", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL");
        selenium.Type("id=logEn", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL");
        selenium.Type("id=logId", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL");
        selenium.Type("id=logAKey", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL");
        selenium.Click("id=btnAliyunSubmit");
        PrintStep();
        //
        PrintTitle("Check Private Server items");
        selenium.Select("id=selCloud", "label=  Private Server");
        selenium.Type("id=logIP", "999.999.999.999.999.999.999.999.999.999.999.999.999.999.999.999A");
        selenium.Type("id=logPWeb", "65535");
        selenium.Type("id=logUurl", "/abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijab@");
        selenium.Type("id=logDurl", "/12345678901234567890123456789012345678901234567890123456789012X");
        selenium.Type("id=logSurl", "/ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJAB$");
        selenium.Click("id=RadioSslEnable");
        selenium.Type("id=logPu", "12345678901234567890123456789012");
        selenium.Type("id=logPw", "1234567890ABCDEF");
        selenium.Click("id=btnPrivateServerSubmit");
        PrintStep();
        //
        PrintTitle("Check WebAccess items");
        selenium.Select("id=selCloud", "label=  WebAccess");
        selenium.Type("id=Nm", "999.999.999.999.999.999.999.999.999.999.999.999.999.999.999.999A");
        selenium.Type("id=PNm", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF");
        selenium.Type("id=NNm", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF");
        selenium.Type("id=HbF", "65535");
        selenium.Type("id=PWeb", "65535");
        selenium.Click("id=waSslEnable");
        selenium.Type("id=Pu", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF");
        selenium.Type("id=Pw", "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEF");
        selenium.Click("id=btnWebAccessSubmit");
        PrintStep();

        selenium.Close();
    }
Ejemplo n.º 4
0
    private void WorkSteps()
    {
        errorCnt = 0;
        selenium = new AdvSeleniumAPIv2();

        selenium.StartupServer("http://" + textBox1.Text);
        System.Threading.Thread.Sleep(1000);

        selenium.Type("id=ACT0", "root");
        selenium.Type("id=PWD0", "00000000");
        selenium.Click("id=APY0");
        selenium.WaitForPageToLoad("30000");
        PrintStep();
        //先確認DUT在哪個MODE底下
        PrintTitle("Check DUT mode");
        var mod = selenium.GetValue("id=inpWMd");

        PrintStep();
        //
        PrintTitle("Check Network Setting");
        selenium.Click("id=configuration");
        selenium.Click("link=Network App");
        //selenium.Type("id=inpPWeb", "80");
        //selenium.Click("id=btnPWeb");
        //
        selenium.Type("id=inpIdl", "4095");
        selenium.Click("id=btnIdl");
        //
        if (mod == "Normal Mode")
        {
            System.Threading.Thread.Sleep(15000);
            selenium.Type("id=ACT0", "root");
            selenium.Type("id=PWD0", "00000000");
            selenium.Click("id=APY0");
            selenium.WaitForPageToLoad("30000");
            selenium.Click("id=configuration");
            selenium.Click("link=Network App");
            PrintStep();
        }
        //
        selenium.Select("id=inpCWDT", "label=Communication WDT");
        selenium.Click("id=btnCWDT");
        PrintStep();
        selenium.Close();
    }
Ejemplo n.º 5
0
    private void WorkSteps()
    {
        errorCnt = 0;
        selenium = new AdvSeleniumAPIv2();

        selenium.StartupServer("http://" + textBox1.Text);
        System.Threading.Thread.Sleep(1000);

        selenium.Type("id=ACT0", "root");
        selenium.Type("id=PWD0", "00000000");
        selenium.Click("id=APY0");
        selenium.WaitForPageToLoad("30000");
        PrintStep();
        //
        if (dev.ModuleType == "WISE-4050/LAN" ||
            dev.ModuleType == "WISE-4060/LAN" ||
            dev.ModuleType == "WISE-4010/LAN")
        {
            PrintTitle("Setting Wireless Config in Network Mode...");
            selenium.Click("id=configuration");
            selenium.Click("link=Network");
            selenium.Type("id=inpIP", AddressIP);
            selenium.Type("id=inpMsk", "255.255.0.0");
            selenium.Type("id=inpGW", "192.168.0.1");
            selenium.Click("id=RadioIpDHCP");
            selenium.Click("id=RadioIpStatic");
            selenium.Click("id=btnNetworkConfig");
            PrintStep();
            System.Threading.Thread.Sleep(10000);
        }
        else
        {
            if (chkMod.Checked)
            {
                PrintTitle("Setting Wireless Config in AP Mode...");
                selenium.Click("id=configuration");
                selenium.Click("link=Wireless");
                selenium.Select("id=selMd", "label=Infrastructure Mode");
                selenium.Type("id=inpISSID", "123456789012345678901234567890AB");
                selenium.Select("id=selISec", "label=Security WPA/WPA2");
                selenium.Type("id=inpIKey", "123456789012345678901234567890123456789012345678901234567890ABC");
                selenium.Type("id=inpISSID2", "123456789012345678901234567890AB");
                selenium.Select("id=selISec2", "label=Security WPA/WPA2");
                selenium.Type("id=inpIKey2", "123456789012345678901234567890123456789012345678901234567890ABC");
                selenium.Type("id=inpIP", AddressIP);
                selenium.Type("id=inpMsk", "255.255.255.248");
                selenium.Type("id=inpGW", "255.255.255.254");
                selenium.Click("id=inpIpStatic");
                selenium.Click("id=btnWLanConfig");
                PrintStep();
                //
                selenium.Select("id=selMd", "label=AP Mode");
                selenium.Type("id=inpASSID", "WISE-40XX-Test");
                selenium.Click("id=inpAHid");
                selenium.Select("id=selACnty", "label=EU (1~13)");
                selenium.Type("id=inpACh", "13");
                selenium.Select("id=selASec", "label=Security WPA/WPA2");
                selenium.Type("id=inpAKey", "123456789012345678901234567890123456789012345678901234567890ABC");
                selenium.Click("id=btnWLanConfig");
                PrintStep();
            }
            else
            {
                PrintTitle("Setting Wireless Config in Infra Mode...");
                selenium.Click("id=configuration");
                selenium.Click("link=Wireless");
                selenium.Select("id=selMd", "label=Infrastructure Mode");
                selenium.Type("id=inpISSID", "IAG_DQA_LAB");
                selenium.Select("id=selISec", "label=Security WPA/WPA2");
                selenium.Type("id=inpIKey", "00000000");
                selenium.Type("id=inpIP", AddressIP);
                selenium.Type("id=inpMsk", "255.255.0.0");
                selenium.Type("id=inpGW", "192.168.0.1");
                selenium.Click("id=inpIpStatic");
                selenium.Click("id=btnWLanConfig");
                PrintStep();
            }
        }


        selenium.Close();
    }
Ejemplo n.º 6
0
Archivo: Form1.cs Proyecto: IAGDQA/WISE
    private void WorkSteps()
    {
        ResFlg   = false; errorCnt = 0;
        selenium = new AdvSeleniumAPIv2();

        selenium.StartupServer("http://" + textBox1.Text);
        System.Threading.Thread.Sleep(1000);
        PrintTitle("Link web");
        selenium.Type("id=ACT0", "root");
        selenium.Type("id=PWD0", "00000000");
        selenium.Click("id=APY0");
        selenium.WaitForPageToLoad("30000");
        PrintStep();
        //先確認DUT在哪個MODE底下
        PrintTitle("Check DUT mode");
        var mod = DUT_mod = selenium.GetValue("id=inpWMd");

        PrintTitle("Mode is in [" + DUT_mod + "].");
        PrintStep();
        //
        if (mod == "Normal Mode")
        {
            PrintTitle("Disable item");
            selenium.Click("id=configuration");
            selenium.Click("link=Cloud");

            var idx = selenium.GetSelectedIndex("id=selCloud");
            //if(idx == "1")
            {
                selenium.Select("id=selCloud", "label=  Disable");
                selenium.Click("id=btnCloudDisableSubmit");
                System.Threading.Thread.Sleep(1000);
                PrintStep();
            }
            //
            PrintTitle("Check Dropbox items");
            selenium.Select("id=selCloud", "label=  Dropbox");
            System.Threading.Thread.Sleep(1000);
            var idx2 = selenium.GetSelectedIndex("id=selCloud");
            if (idx2 != "1")
            {
                PrintTitle("Select index fail...");
                return;
            }
            PrintTitle("Open Dropbox setting page.");
            selenium.Click("id=btnDropBoxAuthenticate");
            selenium.WaitForPopUp("", "30000");
            PrintStep();

            var res = selenium.GetAllWindowNames();
            //
            PrintTitle("Operation Dropbox setting page.");
            selenium.SelectPopUp(res[1]);
            selenium.Click("//div[2]/input");
            selenium.Type("//div[2]/input", "*****@*****.**");
            selenium.Type("//div[2]/div[2]/input", "dqadqa");
            PrintStep();
            selenium.Click("css=button.login-button.button-primary");
            selenium.WaitForPageToLoad("5000");
            selenium.Click("//button[@name='allow_access']");
            PrintStep();
            selenium.WaitForPageToLoad("30000");
            selenium.Click("css=input.auth-box");
            PrintStep();
            var DboxCode = selenium.GetValue("css=input.auth-box");
            selenium.DeselectPopUp();
            PrintStep();
            //
            PrintTitle("Operation Main page.");
            //selenium.SelectWindow(res[0]);
            selenium.Click("id=carouselBtnNext");
            selenium.Type("css=div.input-group > #inpCode", DboxCode);//DboxCode//"aaaa"
            selenium.Click("id=carouselBtnSubmit");
            System.Threading.Thread.Sleep(5000);
            //20161026 fix for wise lan modules.
            if (dev.ModuleType == "WISE-4050/LAN" ||
                dev.ModuleType == "WISE-4060/LAN" ||
                dev.ModuleType == "WISE-4010/LAN")
            {
                selenium.Click("css=div.item.active > div.carousel-caption > p > button.btn.btn-success");
            }
            else
            {
                selenium.Click("id=btnBack");
            }
            PrintStep();
            //check the result
            PrintTitle("Check link result.");
            System.Threading.Thread.Sleep(3000);
            var resCRdy = selenium.GetValue("id=inpCRdy");
            PrintTitle("resCRdy is [" + resCRdy + "].");
            if (resCRdy == "Token ready")
            {
                ResFlg = true;
                PrintTitle("Success linking....");
            }
            else
            {
                PrintTitle("Fail link.");
            }
            PrintStep();
        }
        else
        {
            PrintTitle("Mode is not in [Normal Mode].");
        }


        selenium.Close();
    }
Ejemplo n.º 7
0
    private void WorkSteps()
    {
        errorCnt = 0;
        if (dev.ModuleType == "WISE-4051")
        {
            selenium = new AdvSeleniumAPIv2();

            selenium.StartupServer("http://" + textBox1.Text);
            System.Threading.Thread.Sleep(1000);

            selenium.Type("id=ACT0", "root");
            selenium.Type("id=PWD0", "00000000");
            selenium.Click("id=APY0");
            selenium.WaitForPageToLoad("30000");
            PrintStep();
            for (int i = 0; i < 1; i++)
            {
                selenium.Click("id=ioStatus0");
                selenium.Click("link=COM1");
                selenium.Click("link=Modbus/RTU Configuration");
                if (i > 0)
                {
                    selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div/div/div/div/select"
                                    , "label=9600 bps");
                    selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div/div/div[2]/div/select"
                                    , "label=7 bit");
                    selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div/div/div[3]/div/select"
                                    , "label=Odd");
                    selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div/div/div[4]/div/select"
                                    , "label=1 bit");
                    PrintStep();
                }
                else
                {
                    selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div/div/div/div/select"
                                    , "label=115200 bps");
                    selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div/div/div[2]/div/select"
                                    , "label=8 bit");
                    selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div/div/div[3]/div/select"
                                    , "label=Even");
                    selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div/div/div[4]/div/select"
                                    , "label=2 bit");
                    PrintStep();
                }

                selenium.Type("xpath=(//input[@type='number'])[11]", "5000");
                selenium.Type("xpath=(//input[@type='number'])[12]", "1000");
                selenium.Click("name=004");
                //
                selenium.Click("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div/form/div[2]/div/button");
                selenium.Click("link=Rule Setting");
                PrintStep();

                //rule 01
                selenium.Type("xpath=(//input[@type='number'])[13]", "20" + i.ToString());
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr/td[3]/select"
                                , "label=01 Coil status");
                selenium.Type("xpath=(//input[@type='number'])[14]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[15]", "4");
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr/td[6]/select"
                                , "label=R/W");
                selenium.Type("xpath=(//input[@type='number'])[16]", "999" + i.ToString());
                selenium.Click("xpath=(//input[@type='checkbox'])[19]");
                PrintStep();

                //rule 02
                selenium.Type("xpath=(//input[@type='number'])[18]", "20" + (i + 1).ToString());
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[2]/td[3]/select"
                                , "label=02 Input status");
                selenium.Type("xpath=(//input[@type='number'])[19]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[20]", "4");
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[2]/td[6]/select"
                                , "label=R/W");
                selenium.Type("xpath=(//input[@type='number'])[21]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[22]", "4");
                selenium.Click("xpath=(//input[@type='checkbox'])[20]");
                PrintStep();

                //rule 03
                selenium.Type("xpath=(//input[@type='number'])[23]", "20" + (i + 2).ToString());
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[3]/td[3]/select"
                                , "label=01 Coil status");
                selenium.Type("xpath=(//input[@type='number'])[24]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[25]", "4");
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[3]/td[6]/select"
                                , "label=R/W");
                selenium.Type("xpath=(//input[@type='number'])[26]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[27]", "8");
                selenium.Click("xpath=(//input[@type='checkbox'])[21]");
                PrintStep();

                //rule 04
                selenium.Type("xpath=(//input[@type='number'])[28]", "20" + (i + 3).ToString());
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[4]/td[3]/select"
                                , "label=02 Input status");
                selenium.Type("xpath=(//input[@type='number'])[29]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[30]", "4");
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[4]/td[6]/select"
                                , "label=R/W");
                selenium.Type("xpath=(//input[@type='number'])[31]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[32]", "12");
                selenium.Click("xpath=(//input[@type='checkbox'])[22]");
                PrintStep();

                //rule 05
                selenium.Type("xpath=(//input[@type='number'])[33]", "20" + (i + 4).ToString());
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[5]/td[3]/select"
                                , "label=03 Holding register");
                selenium.Type("xpath=(//input[@type='number'])[34]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[35]", "4");
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[5]/td[6]/select"
                                , "label=R/W");
                selenium.Type("xpath=(//input[@type='number'])[36]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[37]", "16");
                selenium.Click("xpath=(//input[@type='checkbox'])[23]");
                PrintStep();

                //rule 06
                selenium.Type("xpath=(//input[@type='number'])[38]", "20" + (i + 5).ToString());
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[6]/td[3]/select"
                                , "label=04 Input register");
                selenium.Type("xpath=(//input[@type='number'])[39]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[40]", "4");
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[6]/td[6]/select"
                                , "label=R/W");
                selenium.Type("xpath=(//input[@type='number'])[41]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[42]", "20");
                selenium.Click("xpath=(//input[@type='checkbox'])[24]");
                PrintStep();

                //rule 07
                selenium.Type("xpath=(//input[@type='number'])[43]", "20" + (i + 6).ToString());
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[7]/td[3]/select"
                                , "label=03 Holding register");
                selenium.Type("xpath=(//input[@type='number'])[44]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[45]", "4");
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[7]/td[6]/select"
                                , "label=R/W");
                selenium.Type("xpath=(//input[@type='number'])[46]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[47]", "24");
                selenium.Click("xpath=(//input[@type='checkbox'])[25]");
                PrintStep();

                //rule 08
                selenium.Type("xpath=(//input[@type='number'])[48]", "20" + (i + 7).ToString());
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[8]/td[3]/select"
                                , "label=04 Input register");
                selenium.Type("xpath=(//input[@type='number'])[49]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[50]", "4");
                selenium.Select("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div/table/tbody/tr[8]/td[6]/select"
                                , "label=R/W");
                selenium.Type("xpath=(//input[@type='number'])[51]", "999" + i.ToString());
                selenium.Type("xpath=(//input[@type='number'])[52]", "28");
                selenium.Click("xpath=(//input[@type='checkbox'])[25]");
                PrintStep();

                //
                selenium.Click("//div[@id='TabCom1']/div/div/div/div[2]/div/div[2]/div/div[2]/form/div[2]/button");
            }

            selenium.Close();
        }
        else
        {
            PrintTitle("Module not support.");
        }
    }
Ejemplo n.º 8
0
 void UIConfgBlock()
 {
     if (dev.ModuleType.ToUpper() == "WISE-4012")
     {
         PrintTitle("UIConfg");
         selenium.Click("id=ioStatus0");
         for (int i = 0; i < ai_num; i++)
         {
             selenium.Select("id=selMd_" + i.ToString(), "label=AI");
         }
         selenium.Click("id=btnUIConfig");
         PrintStep();
     }
 }
Ejemplo n.º 9
0
 void DOExeDOconfig()
 {
     PrintTitle("DOExeDOconfig");
     EnterDOConfigPage();
     for (int i = 0; i < do_num; i++)
     {
         selenium.Select("css=#doConfigBaseForm > div.panel-heading > div.form-group > div.col-lg-3 > div.input-group > #selCh", "label=" + i.ToString());
         selenium.Type("css=#doConfigBaseForm > div.panel-heading > div.form-group > div.col-lg-6 > div.input-group > #inpTag", "ABCDEFGHIJKLMNOPQRST" + i.ToString());
         selenium.Select("css=#doConfigBaseForm > div.panel-heading > div.form-group > div.col-lg-2 > div.input-group > #selMd", "label=DO");
         selenium.Click("id=inpFSV");
         selenium.Click("css=#doConfigBaseForm > div.panel-footer.clearfix > div.pull-right > #btnSubmit");
         PrintStep();
     }
     //All
     selenium.Select("css=#doConfigBaseForm > div.panel-heading > div.form-group > div.col-lg-3 > div.input-group > #selCh", "label=All");
     selenium.Select("css=#doConfigBaseForm > div.panel-heading > div.form-group > div.col-lg-2 > div.input-group > #selMd", "label=DO");
     selenium.Click("id=inpFSV");
     selenium.Click("css=#doConfigBaseForm > div.panel-footer.clearfix > div.pull-right > #btnSubmit");
     PrintStep();
     // check the view
     selenium.Click("xpath=(//a[contains(text(),'Status')])[3]");
     for (int i = 0; i < do_num; i++)
     {
         selenium.Click("id=switchDO_" + i.ToString());
     }
 }
Ejemplo n.º 10
0
    private void WorkSteps()
    {
        errorCnt = 0;
        selenium = new AdvSeleniumAPIv2();

        selenium.StartupServer("http://" + textBox1.Text);
        System.Threading.Thread.Sleep(1000);

        selenium.Type("id=ACT0", "root");
        selenium.Type("id=PWD0", "00000000");
        selenium.Click("id=APY0");
        selenium.WaitForPageToLoad("30000");
        PrintStep();
        //先確認DUT在哪個MODE底下
        PrintTitle("Check DUT mode");
        //selenium.Click("id=information");
        var mod = selenium.GetValue("id=inpWMd");

        PrintStep();
        //
        PrintTitle("Time & Date");
        selenium.Click("id=configuration");
        selenium.Click("link=Time & Date");
        selenium.Select("id=selTZ", "label=(GMT+13:00) Nuku'alofa");
        selenium.Click("id=btnTZ");
        PrintStep();
        //
        PrintTitle("Time Sync for SNTP");
        selenium.Click("link=Time Sync");
        selenium.Select("id=inpEnSNTP", "label=SNTP");
        selenium.Type("id=inpSNTP1", "123456789012345678901234567890123456789012345678901234567890"
                      + "ABC");
        selenium.Type("id=inpSNTP2", "123456789012345678901234567890123456789012345678901234567890"
                      + "ABC");
        selenium.Type("id=inpPollingRate", "9999999");
        selenium.Click("id=btnAll");
        PrintStep();
        PrintTitle("Mode is [" + mod + "].");
        //When in infra mode would reset page. Relog-in.
        //Actually happen in Wireless modules.
        if (dev.ModuleType == "WISE-4050/LAN" ||
            dev.ModuleType == "WISE-4060/LAN" ||
            dev.ModuleType == "WISE-4010/LAN")
        {
            PrintTitle("Module would not restart.");
        }
        else
        {
            if (mod == "Normal Mode")
            {
                System.Threading.Thread.Sleep(15000);
                selenium.Type("id=ACT0", "root");
                selenium.Type("id=PWD0", "00000000");
                selenium.Click("id=APY0");
                selenium.WaitForPageToLoad("30000");
                PrintStep();
            }
        }
        //
        PrintTitle("Time Sync for WA");
        selenium.Click("id=configuration");
        selenium.Click("link=Time Sync");
        selenium.Select("id=inpEnSNTP", "label=WebAccess");
        selenium.Click("id=btnAll");
        PrintStep();
        //When in infra mode would reset page. Relog-in.
        if (dev.ModuleType == "WISE-4050/LAN" ||
            dev.ModuleType == "WISE-4060/LAN" ||
            dev.ModuleType == "WISE-4010/LAN")
        {
            PrintTitle("Module would not restart.");
        }
        else
        {
            if (mod == "Normal Mode")
            {
                System.Threading.Thread.Sleep(15000);
                selenium.Type("id=ACT0", "root");
                selenium.Type("id=PWD0", "00000000");
                selenium.Click("id=APY0");
                selenium.WaitForPageToLoad("30000");
                PrintStep();
            }
        }

        //
        PrintTitle("General Setting");
        selenium.Click("id=configuration");
        selenium.Click("link=General");
        selenium.Type("id=inpPollingRate", "9999999");
        selenium.Click("id=btnPollingRate");
        selenium.Click("id=inpEnWF");
        selenium.Click("id=inpEnWF");
        selenium.Click("id=btnEnWF");
        PrintStep();
        selenium.Close();
    }
Ejemplo n.º 11
0
 void UIConfgBlock()//for WISE-4012
 {
     PrintTitle("UIConfg");
     selenium.Click("id=ioStatus0");
     System.Threading.Thread.Sleep(1000);
     for (int i = 0; i < di_num; i++)
     {
         selenium.Select("id=selMd_" + i.ToString(), "label=DI");
     }
     selenium.Click("id=btnUIConfig");
     PrintStep();
 }
Ejemplo n.º 12
0
    private void WorkSteps()
    {
        ResFlg = false; errorCntStep = 0;
        // 取得本機名稱
        string strHostName = Dns.GetHostName();
        // 取得本機的IpHostEntry類別實體,MSDN建議新的用法
        IPHostEntry iphostentry = Dns.GetHostEntry(strHostName);

        // 取得所有 IP 位址
        System.Collections.ArrayList ipList = new System.Collections.ArrayList();
        foreach (IPAddress ipaddress in iphostentry.AddressList)
        {
            // 只取得IP V4的Address
            if (ipaddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
            {
                ipList.Add(ipaddress.ToString());
                //Console.WriteLine("Local IP: " + ipaddress.ToString());
            }
        }
        if (ipList.Count < 1)
        {
            PrintTitle("Get Host IP fail.");
            return;
        }
        string[] HostIP = new string[ipList.Count];
        int      i      = 0;

        foreach (var item in ipList)
        {
            HostIP[i] = (string)item;
            i++;
        }
        //
//#if Debug
        devMac   = "";
        selenium = new AdvSeleniumAPIv2();

        selenium.StartupServer("http://" + textBox1.Text);
        System.Threading.Thread.Sleep(1000);

        selenium.Type("id=ACT0", "root");
        selenium.Type("id=PWD0", "00000000");
        selenium.Click("id=APY0");
        selenium.WaitForPageToLoad("30000");
        PrintStep();
        //先確認DUT在哪個MODE底下
        PrintTitle("Check DUT mode");
        var mod = DUT_mod = selenium.GetValue("id=inpWMd");

        PrintStep();
        //
        if (mod == "Normal Mode")
        {
            PrintTitle("Get device MAC address");
            selenium.Click("id=configuration");
            if (dev.ModuleType.ToUpper() == "WISE-4050/LAN" ||
                dev.ModuleType.ToUpper() == "WISE-4060/LAN" ||
                dev.ModuleType.ToUpper() == "WISE-4010/LAN")
            {
                selenium.Click("link=Network");
            }
            else
            {
                selenium.Click("link=Wireless");
            }

            devMac = selenium.GetValue("id=inpMAC");
            PrintStep();
            PrintTitle("Get MAC address is [" + devMac + "]");
            //
            PrintTitle("Check Private Server items");
            selenium.Click("id=configuration");
            selenium.Click("link=Cloud");
            selenium.Select("id=selCloud", "label=  Private Server");
            selenium.Type("id=logIP", HostIP[0]);
            selenium.Type("id=logPWeb", "8000");
            selenium.Type("id=logUurl", "/upload_log");
            selenium.Type("id=logDurl", "/io_log");
            selenium.Type("id=logSurl", "/sys_log");
            selenium.Click("id=RadioSslDisable");
            selenium.Click("id=btnPrivateServerSubmit");
            selenium.Type("id=logPu", "root");
            selenium.Type("id=logPw", "00000000");
            PrintStep();
            //
            PrintTitle("Enable [By Period] checkbox");
            selenium.Click("id=configuration");
            selenium.Click("id=advancedFunction");
            selenium.Click("id=dataLog");
            selenium.Type("id=inpPItv", "1");
            var res = selenium.GetValue("id=inpPer");
            if (selenium.GetValue("id=inpPer") == "off")
            {
                selenium.Click("id=inpPer");
            }
            selenium.Click("id=btnLogConfigAll");
            PrintStep();
            //
            selenium.Click("id=advancedFunction");
            selenium.Click("id=dataLog");
            selenium.Click("link=Logger Configuration");
            PrintTitle("Enable [IO Log] checkbox");
            if (selenium.GetValue("id=memDEn") == "off")
            {
                selenium.Click("id=memDEn");
            }
            PrintStep();
            PrintTitle("Enable [Cloud Upload] checkbox");
            if (selenium.GetValue("id=cloudEn") == "off")
            {
                selenium.Click("id=cloudEn");
            }
            selenium.Select("id=selDEn", "label=Item Periodic Interval mode");
            selenium.Type("id=inpDItm", "1");
            selenium.Type("id=inpDTag", "WISE_PrvSrv_AUTOTEST");
            if (selenium.GetValue("id=pushDEn") == "off")
            {
                selenium.Click("css=#push_output > div.form-group.row > div.col-lg-12 > div.col-sm-10 > div.input-group > div.SliderSwitch > label.SliderSwitch-label > span.SliderSwitch-inner");
            }
            selenium.Click("id=btnLoggerConfigSubmit");
            PrintStep();
        }
        else
        {
            PrintTitle("Mode is not in [Normal Mode].");
        }
        //
        selenium.Close();
//#endif
        //
        StartListener();
        int WDT = 0;

        while (Listening)
        {
            PrintTitle("Listening");
            Application.DoEvents();
            if (WDT > 999)
            {
                PrintTitle("Timeout....");
                break;
            }
            WDT++;
        }
    }