public void Wireless_Mode_Selection_5GHz(string argument1)
        {
            Delay.Seconds(5);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Report.Info("Wireless Mode(argument1) : " + argument1);
            //Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'Channel50']");
            //Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'WiFi50ChannelBW']");
            Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'WirelessMode50']");
            Report.Info(protocolTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in protocolTag.Find(".//option"))
            {
                Report.Info(optTag.InnerText);
                if (optTag.InnerText.Trim() == argument1.Trim())
                {
                    Report.Info("5GHz Matching-True", argument1);
                    optTag.Selected = true;
                    optTag.Click();
                    optTag.PerformClick();
                    break;
                }
            }
//          TableTag table_2GHz = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'WirelessFrequency50GHz']/table");
//          Report.Screenshot("Wireless_5GHz",table_2GHz.Element,false);
            Report.Screenshot();
        }
示例#2
0
        public void Validate_SecurityMode_5GHz_Primary(string argument1)
        {
            //Validate_SecurityMode_5GHz_Primary
            if (argument1 == "")
            {
                argument1 = "WPA-PSK/WPA2-PSK";
            }
            Delay.Seconds(15);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            //Ranorex.SelectTag securityTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_SecurityModeGrp']/select[#'SecurityModeGrp']");
            Ranorex.SelectTag securityTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_SecurityModeGrp50']/select[#'SecurityModeGrp50']");
//	         Ranorex.SelectTag securityTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_SecurityMode50']/select[#'SecurityMode50']");
//	        Ranorex.SelectTag securityTag = webDocument.FindSingle("dom[@domain='192.168.0.1']//select[#'SecurityMode50']");

            Report.Info(securityTag.GetInnerHtml().ToString());


            foreach (Ranorex.OptionTag optTag in securityTag.Find(".//option"))
            {                   //TO SELECT THE SecurityMode
                //Console.WriteLine(optTag.InnerText);
                Report.Info(optTag.InnerText);
                //get the currently selected item name and check if it is Disable

                /*
                 * Report.Info(optTag.Element.GetAttributeValueText("selected"));
                 * if(optTag.Element.GetAttributeValueText("selected").Equals("Disable")){
                 *      Report.Info("security mode cannot be Disable ");
                 * }
                 */
                if (optTag.Element.GetAttributeValueText("selected").Equals("Disable"))
                {
                    // security mode cannot be Disable, so need to change the mode
                    OptionTag optionTag = argument1;
                    optionTag.Selected = true;
                }
                else if (optTag.InnerText == argument1)
                {
                    Report.Info("argument2 matching:: " + argument1);
                    // OptionTag option = "//rxpath/to/option";
                    //option.Selected = true;
                    optTag.Selected = true;
                    Report.Success("Security Mode changed successfully !");
//	                    Report.Screenshot("Security Mode",securityTag.Element,true);
                    Report.Screenshot();
                    break;
                }
            }                   // end of for-loop
            Report.Screenshot();
        }
示例#3
0
        public void update_the_values_for_add_forward_rule(string argument1, string argument2)
        {               //argument1 - Protocol
                        //argument2 - Enable?
            //update the protocol and EnableDisable fields

            //Report.Info("inside pdate_the_values_for_add_forward_rule--- argument1 :" + argument1 + " argument2 : " + argument2);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'Protocol']");
            //Report.Info(protocolTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in protocolTag.Find(".//option"))
            {           //TO SELECT THE PROTOCOL
                //Console.WriteLine(optTag.InnerText);
                Report.Info(optTag.InnerText);
                if (optTag.InnerText == argument1)
                {
                    Report.Info("argument2 matching:: " + argument1);
                    // OptionTag option = "//rxpath/to/option";
                    //option.Selected = true;
                    optTag.Selected = true;
                    break;
                }
            }                   //end of for-loop for Protocol

            Report.Info("enable/disable Status : " + argument2);
            Ranorex.SelectTag enableTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'Enabled']");
            //Ranorex.SelectTag enableTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_Enabled']/select[@id='Enabled']");
            Report.Info(enableTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in enableTag.Find(".//option"))
            {                   //TO enable/disable  PORT TRIGGER RULE
                //Console.WriteLine(optTag.InnerText);
                Report.Info(optTag.InnerText);
                if (optTag.InnerText == argument2)
                {
                    Report.Info("argument2 matching:: " + argument2);
                    optTag.Selected = true;
                    break;
                }
            }                   //end of for-loop for  enable /disable
        }
示例#4
0
        public void Choose_IPv6_Port_Filter_Protocol_SourceIP_DestIPCategory(string argument1, string argument2, string argument3)
        {
            //select combo box values for protocol, sourceIP, Dest IP
            //argument1 - protocol,
            //argument2 - SourceIP group category
            //argument3 - DestinationIP group category

//          Report.Info("------------Inside Update_Combo_Boxes_For_IPv6Filtering_Rule------------- ");
            Report.Info("------------ Inside Choose_IPv6_Port_Filter_Protocol_SourceIP_DestIPCategory  ------------ ");
            Report.Info("Protocol(argument1) : " + argument1);
//          Report.Info("Source IP Group(argument2) : "+argument2);
//			Report.Info("Destination IP Category(argument3) : "+argument3);

            Delay.Seconds(5);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            //choose protocol
            Ranorex.SelectTag IPv4protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv6ProtocolGrp']");
            Report.Info(IPv4protocolTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in IPv4protocolTag.Find(".//option"))
            {                   //TO SELECT THE PROTOCOL
                if (optTag.InnerText == argument1)
                {
                    optTag.Selected = true;
                    //Delay.Seconds(1);
                    break;
                }
            }
            Report.Info("Source IP Group(argument2) : " + argument2);
            //choose source IP group
            Ranorex.SelectTag IPv6SrcIPGrpTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv6SrcIPGrp']");
            Report.Info(IPv6SrcIPGrpTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in IPv6SrcIPGrpTag.Find(".//option"))
            {                           //TO enable/disable  PORT TRIGGER RULE
                if (optTag.InnerText == argument2)
                {
                    optTag.Selected = true;
                    //Delay.Seconds(1);
                    //check Source IP Group
                    if ((argument2 == "single") || (argument2 == "Single"))                     // if it is single source Source IP
                    {
                        TestSuite.Current.GetTestCase("Input_Single_SourceIPv6").Checked = true;
                        TestSuite.Current.GetTestCase("Input_Range_SourceIPv6").Checked  = false;
                    }
                    else if ((argument2 == "range") || (argument2 == "Range"))                  //if it is  range source IP
                    {
                        TestSuite.Current.GetTestCase("Input_Range_SourceIPv6").Checked  = true;
                        TestSuite.Current.GetTestCase("Input_Single_SourceIPv6").Checked = false;
                    }
                    break;
                }
            }
            Report.Info("Destination IP Category(argument3) : " + argument3);
            //choose destination Ip group
            Ranorex.SelectTag IPv6DestIPGrpTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv6DestIPGrp']");
            Report.Info(IPv6DestIPGrpTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in IPv6DestIPGrpTag.Find(".//option"))
            {                           //TO enable/disable  PORT TRIGGER RULE
                if (optTag.InnerText == argument3)
                {
                    optTag.Selected = true;
                    //Delay.Seconds(1);
                    //check Source IP Group
                    if ((argument3 == "single") || (argument3 == "Single"))                     // if it is single source Source IP
                    {
                        TestSuite.Current.GetTestCase("Input_Single_DestIPv6").Checked = true;
                        TestSuite.Current.GetTestCase("Input_Range_DestIPv6").Checked  = false;
                    }
                    else if ((argument3 == "range") || (argument3 == "Range"))                          //if it is  range source IP
                    {
                        TestSuite.Current.GetTestCase("Input_Range_DestIPv6").Checked  = true;
                        TestSuite.Current.GetTestCase("Input_Single_DestIPv6").Checked = false;
                    }
                    break;
                }
            }
            Report.Screenshot();
        }
示例#5
0
        public void Validate_SecurityMode(string argument1)
        {
            //validate and find the selected item name
            // Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (Text='yourtext') on item 'WebDocument19216801.FmSelSecurityModeGrp.SomeSpanTag4'.", repo.WebDocument19216801.FmSelSecurityModeGrp.SomeSpanTag4Info);
            // Validate.Attribute(repo.WebDocument19216801.FmSelSecurityModeGrp.SomeSpanTag4Info, "Text", "yourtext");

            /*
             * bool boolVal = Validate.IsTrue(repo.WebDocument19216801.FmSelSecurityModeGrp.SomeSpanTag4Info, "Text","Disable");
             *  if(boolVal == true){
             *  //string rstStr = "The Password : "******" : is : " + repo.WebDocument19216801.PasstextWifi.InnerText ;
             *            Report.Log(ReportLevel.Info, "Validation","Disable");
             * }else{
             *       // string rstStr = "The Password : "******" : is : " + repo.WebDocument19216801.PasstextWifi.InnerText ;
             *            Report.Log(ReportLevel.Info, "Validation","other than Disable");
             * }
             */

            //  Report.Log(ReportLevel.Info,repo.WebDocument19216801.FmSelSecurityModeGrp);

            Report.Info(" Inside Validate_SecurityMode  " + "argument1 : " + argument1);
            if (argument1 == "")
            {
                argument1 = "WPA-PSK/WPA2-PSK";
                Report.Info(" argument1 is blank so assigned the security mode - WPA-PSK/WPA2-PSK");
            }
            Delay.Seconds(60);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            webDocument.WaitForDocumentLoaded();
            // Ranorex.SelectTag securityTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'Protocol']");
            // Ranorex.SelectTag enableTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_Enabled']/select[@id='Enabled']");

//	         Ranorex.SelectTag securityTag = webDocument.FindSingle("dom[@domain='192.168.0.1']//select[#'SecurityModeGrp']");
            Ranorex.SelectTag securityTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_SecurityModeGrp']/select[#'SecurityModeGrp']");


            Report.Info(securityTag.GetInnerHtml().ToString());

            foreach (Ranorex.OptionTag optTag in securityTag.Find(".//option"))
            {                   //TO SELECT THE SecurityMode
                //Console.WriteLine(optTag.InnerText);
                Report.Info(optTag.InnerText);
                //get the currently selected item name and check if it is Disable

                /*
                 * Report.Info(optTag.Element.GetAttributeValueText("selected"));
                 * if(optTag.Element.GetAttributeValueText("selected").Equals("Disable")){
                 *      Report.Info("security mode cannot be Disable ");
                 * }
                 */
                if (optTag.Element.GetAttributeValueText("selected").Equals("Disable"))
                {
                    // security mode cannot be Disable, so need to change the mode
                    OptionTag optionTag = argument1;
                    optionTag.Selected = true;
                }
                else if (optTag.InnerText == argument1)
                {
                    Report.Info("argument2 matching:: " + argument1);
                    // OptionTag option = "//rxpath/to/option";
                    //option.Selected = true;
                    optTag.Selected = true;
                    Report.Success("Security Mode changed successfully !");
                    //Delay.Seconds(1);
                    //Report.Screenshot("Security Mode",securityTag.Element,false);	//FmSelSecurityModeGrp
                    //Report.Screenshot("Security Mode",repo.WebDocument19216801.SecurityMode.Element,true);
                    Delay.Seconds(1);
                    Report.Screenshot();
                    break;
                }
            }                   // end of for-loop
            Report.Screenshot();
        }