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();
        }
        public void Update_Combo_Boxes_For_IPv4_Filter_Range(string argument1, string argument2, string argument3)
        {
            //select combo box values
            //argument1 - protocol, argument2-Source IP Grp, argument3 - Dest IP Grp
            Delay.Seconds(10);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv4ProtocolGrp']");
            //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("argument1 matching:: "+argument1 );
                    // OptionTag option = "//rxpath/to/option";
                    //option.Selected = true;
                    optTag.Selected = true;
                    break;
                }
            }                           //end of for-loop for Protocol

            //Report.Info("Source IP Group : "+argument2);
            Ranorex.SelectTag IPv4SrcIPGrpTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv4SrcIPGrp']");
            //Ranorex.SelectTag enableTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_Enabled']/select[@id='Enabled']");
            //Report.Info(IPv4SrcIPGrpTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in IPv4SrcIPGrpTag.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 );
                    Delay.Seconds(1);
                    optTag.Selected = true;
                    break;
                }
            }                           //end of for-loop for  Source IP Group

            //Report.Info("Destination IP Category : "+argument3);
            Ranorex.SelectTag IPv4DestIPGrpTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv4DestIPGrp']");
            //Ranorex.SelectTag enableTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_Enabled']/select[@id='Enabled']");
            //Report.Info(IPv4DestIPGrpTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in IPv4DestIPGrpTag.Find(".//option"))
            {                           //TO enable/disable  PORT TRIGGER RULE
                //Console.WriteLine(optTag.InnerText);
                //Report.Info(optTag.InnerText);
                if (optTag.InnerText == argument3)
                {
                    //Report.Info("argument3 matching:: "+argument3 );
                    optTag.Selected = true;
                    break;
                }
            }
        }
Esempio n. 3
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();
        }
        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']";

            // Report.Info("Protocol : "+argument1);
            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("argument1 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
        }
Esempio n. 5
0
        public void New_Port_Triggering_Rule(string argument1, string argument2)
        {
            // argument1 - protocol

            Report.Info("Protocol :" + argument1);
            //Report.Info(" Inside Populate_Port_Triggering_Combo_Boxes  " + "proto : "+argument1 + ": Enabled?:"+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("argument1 matching:: " + argument1);
                    // OptionTag option = "//rxpath/to/option";
                    //option.Selected = true;
                    optTag.Selected = true;
                    break;
                }
            }

            // argument2 - Enabled or Disabled
            Report.Info("RuleStatus : " + 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;
                }
            }
        }
        public void Choose_Manual_Channel_2GHz(string argument1)
        {
            Report.Info("Channel Number(2GHz) : " + argument1);
            int channelNumber = Int32.Parse(argument1.Trim());

            if (channelNumber < 52)
            {
                Delay.Seconds(5);
                WebDocument webDocument = "/dom[@domain='192.168.0.1']";
                //Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv4ProtocolGrp']");
                //Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'WirelessMode50']");
                //Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'WirelessMode24']");
                //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[#'Channel24']");
                //dom[@domain='192.168.0.1']//select[#'WiFi24ChannelBW']
                //dom[@domain='192.168.0.1']//select[#'WiFi50ChannelBW']
                foreach (Ranorex.OptionTag optTag in protocolTag.Find(".//option"))
                {
                    Report.Info(optTag.InnerText);
                    string tempChannel = " Channel " + argument1.Trim();
                    Report.Info("tempChannel : " + tempChannel);
//					if(optTag.InnerText.Trim() == argument1.Trim()){
                    if (optTag.InnerText.Trim() == tempChannel.Trim())
                    {
                        Report.Info("2GHz Matching-True");
                        optTag.Selected = true;
                        break;
                    }
                }
                //captute screen shot
                //TableTag myTable = webDocument.FindSingle("/dom[@domain='192.168.0.1']//table[#'ipv4FilterTable']");
                TableTag table_2GHz = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'WirelessFrequency24GHz']/table");
                Report.Screenshot("Wireless_2.4GHz", table_2GHz.Element, false);
            }
            else
            {
                Report.Info("DFS channel value is >= 52");
                //call another module deal with this
            }
        }
Esempio n. 7
0
        public void Choose_Channel_Width_2GHz(string argument1)
        {
            Delay.Seconds(5);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Report.Info("Protocol(argument1) : " + argument1);
            //Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'Channel24']");
            Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'WiFi24ChannelBW']");
            foreach (Ranorex.OptionTag optTag in protocolTag.Find(".//option"))
            {
                Report.Info(optTag.InnerText);
                if (optTag.InnerText.Trim() == argument1.Trim())
                {
                    Report.Info("2_4GHz Matching-True");
                    optTag.Selected = true;
                    break;
                }
            }
            TableTag table_2GHz = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'WirelessFrequency24GHz']/table");

            Report.Screenshot("Wireless_2.4GHz", table_2GHz.Element, false);
        }
Esempio n. 8
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();
        }
        public void Accept_IPv4_Port_Filter_Protocol_SourceIPCat_DestIPCat(string argument1, string argument2, string argument3)
        {
            //select combo box values
            //argument1 - protocol,
            //argument2 - Source IP group category
            //argument3 - Destination IP group category

            //Report.Info("------------Inside Update_Combo_Boxes_For_IPv4Filtering_Rule------------- ");
            Delay.Seconds(5);
            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            Report.Info("Protocol(argument1) : " + argument1);
            Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv4ProtocolGrp']");
            //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("argument1 matching:: "+argument1 );
                    // OptionTag option = "//rxpath/to/option";
                    //option.Selected = true;
                    optTag.Selected = true;
                    //Delay.Seconds(1);
                    break;
                }
            }                           //end of for-loop for Protocol

            Report.Info("Source IP Group(argument2) : " + argument2);
            Ranorex.SelectTag IPv4SrcIPGrpTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv4SrcIPGrp']");
            //Ranorex.SelectTag enableTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_Enabled']/select[@id='Enabled']");
            //Report.Info(IPv4SrcIPGrpTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in IPv4SrcIPGrpTag.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 );
                    //Delay.Seconds(1);
                    optTag.Selected = true;
                    //Delay.Seconds(1);
                    //check Source IP Group
                    if (argument2 == "single")                          // if it is single source Source IP
                    {
                        TestSuite.Current.GetTestCase("Input_Single_SourceIP1").Checked = true;
                        TestSuite.Current.GetTestCase("Input_Range_SourceIP1").Checked  = false;
                    }
                    else if (argument2 == "range")                      //if it is  range source IP

                    {
                        TestSuite.Current.GetTestCase("Input_Range_SourceIP1").Checked  = true;
                        TestSuite.Current.GetTestCase("Input_Single_SourceIP1").Checked = false;
                    }
                    break;
                }
            }                           //end of for-loop for  Source IP Group

            Report.Info("Destination IP Category(argument3) : " + argument3);
            Ranorex.SelectTag IPv4DestIPGrpTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv4DestIPGrp']");
            //Ranorex.SelectTag enableTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_Enabled']/select[@id='Enabled']");
            //Report.Info(IPv4DestIPGrpTag.GetInnerHtml().ToString());
            foreach (Ranorex.OptionTag optTag in IPv4DestIPGrpTag.Find(".//option"))
            {                           //TO enable/disable  PORT TRIGGER RULE
                //Console.WriteLine(optTag.InnerText);
                //Report.Info(optTag.InnerText);
                if (optTag.InnerText == argument3)
                {
                    //Report.Info("argument3 matching:: "+argument3 );
                    //Delay.Seconds(1);
                    optTag.Selected = true;
                    //Delay.Seconds(1);
                    //check Destination IP Category
                    if (argument3 == "single")                          // if it is single destination Source IP
                    {
                        TestSuite.Current.GetTestCase("Input_Single_DestIP1").Checked = true;
                        TestSuite.Current.GetTestCase("Input_Range_DestIP1").Checked  = false;
                    }
                    else if (argument3 == "range")                      //if it range destination IP

                    {
                        TestSuite.Current.GetTestCase("Input_Range_DestIP1").Checked  = true;
                        TestSuite.Current.GetTestCase("Input_Single_DestIP1").Checked = false;
                    }
                    break;
                }
            }                           //end of for-loop for  Destination IP Group
        }
Esempio n. 10
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();
        }
        public void Choose_Manual_Channel_5GHz(string argument1)
        {
            Report.Info("Channel Number(5GHz) : " + argument1);
            //          int channelNumber = Int32.Parse(argument1);
            int channelNumber = Int32.Parse(argument1.Trim());

            /*	//initialize Channel_5GHz
             * WebDocument webDocument1 = "/dom[@domain='192.168.0.1']";
             * Ranorex.SelectTag protocolTag1 = webDocument1.FindSingle("/dom[@domain='192.168.0.1']//select[#'Channel50']");
             * int i=1;
             * foreach(Ranorex.OptionTag optTag in protocolTag1.Find(".//option"))
             * {
             *      Report.Info(optTag.InnerText);
             *      if(i==1){
             *              optTag.Selected = true;
             *              break;
             *      }
             * }
             */
            if (channelNumber < 52)
            {
                Report.Info("DFS channel value is < 52");
                Delay.Seconds(5);
                WebDocument webDocument = "/dom[@domain='192.168.0.1']";
//				Report.Info("Protocol(argument1) : "+argument1);
                //Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'IPv4ProtocolGrp']");
                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[#'WirelessMode50']");
                foreach (Ranorex.OptionTag optTag in protocolTag.Find(".//option"))
                {
                    Report.Info(optTag.InnerText);
                    string tempChannel = " Channel " + argument1.Trim();
                    Report.Info("tempChannel : " + tempChannel);
//					if(optTag.InnerText.Trim() == argument1.Trim()){
                    if (optTag.InnerText.Trim() == tempChannel.Trim())
                    {
                        Report.Info("5GHz Matching-True");
                        optTag.Selected = true;
                        optTag.Click();
                        break;
                    }
                }
                TableTag table_2GHz = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'WirelessFrequency50GHz']/table");
                Report.Screenshot("Wireless_5GHz", table_2GHz.Element, false);
            }
            else
            {
                Report.Info("DFS channel value is >= 52");
                //call another module deal with this
                Delay.Seconds(5);
                WebDocument       webDocument = "/dom[@domain='192.168.0.1']";
                Ranorex.SelectTag protocolTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'Channel50']");
                foreach (Ranorex.OptionTag optTag in protocolTag.Find(".//option"))
                {
                    Report.Info(optTag.InnerText);
                    string tempChannel = " Channel " + argument1.Trim();
                    Report.Info("tempChannel : " + tempChannel);
                    if (optTag.InnerText.Trim() == tempChannel.Trim())
                    {
                        Report.Info("5GHz Matching-True");
                        optTag.Selected = true;
                        break;
                    }
                }
                Ack_DFS_Channel_Selection.Start();
                TableTag table_2GHz = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'WirelessFrequency50GHz']/table");
                Report.Screenshot("Wireless_5GHz", table_2GHz.Element, false);
            }
            Report.Screenshot();
        }
        public void Populate_Port_Triggering_Combo_Boxes(string argument1, string argument2)
        {
            // argument1 - protocol
            // argument2 - Enabled or Disabled
            //Report.Info("Protocol :"+argument1);
            //Report.Info(" Inside Populate_Port_Triggering_Combo_Boxes  " + "proto : "+argument1 + ": Enabled?:"+argument2);

            //	/dom[@domain='192.168.0.1']//div[#'fmSel-Protocol']//cite[@innertext='UDP']

            WebDocument webDocument = "/dom[@domain='192.168.0.1']";

            //DivTag myDiv = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'fmSel-Protocol']");
            //DivTag myDiv = webDocument.FindSingle("/dom[@domain='192.168.0.1']//div[#'tr_Protocol']");

            // var divTagMydiv = repo.WebDocument.YourElement;
            // String pureInnerText;
            // pureInnerText= Regex.Replace(divTagMydiv.GetInnerHtml(), "<.*?>", string.Empty);
            //pureInnerText = myDiv.GetInnerHtml();
            //pureInnerText= Regex.Replace(myDiv.GetInnerHtml(), "<.*?>", string.Empty);
            //Report.Info("PureInnerText: "+pureInnerText);

            // Ranorex.SelectTag selectTag = Host.Local.FindSingle("/dom[@page='test.html']/body/select");
            Ranorex.SelectTag selectTag = webDocument.FindSingle("/dom[@domain='192.168.0.1']//select[#'Protocol']");
            foreach (Ranorex.OptionTag optTag in selectTag.Find(".//option"))
            {
                //Console.WriteLine(optTag.InnerText);
                Report.Info(optTag.InnerText);
                if (optTag.InnerText == argument1)
                {
                    Report.Info("argument matching:: " + argument1);
                    // OptionTag option = "//rxpath/to/option";
                    //option.Selected = true;
                    optTag.Selected = true;
                }
            }

            if (argument1 == "UDP")
            {
                //Report.Info("UDP.....Protocol :"+argument1);
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_UDP").Checked       = false;  //true - to enable the test cases
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_TCP").Checked       = false;
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_UDPandTCP").Checked = false;
            }
            if (argument1 == "TCP")
            {
                //Report.Info("TCP....Protocol :"+argument1);
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_TCP").Checked       = false;
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_UDP").Checked       = false;
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_UDPandTCP").Checked = false;
            }
            else if (argument1 == "UDP and TCP")
            {
                //Report.Info("UDP and TCP ....Protocol :"+argument1);
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_UDPandTCP").Checked = false;
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_UDP").Checked       = false;
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Protocol_TCP").Checked       = false;
            }

            //Report.Info("RuleStatus : "+argument2);

            // Ranorex.SelectTag selectTag1 = 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']");
            foreach (Ranorex.OptionTag optTag in enableTag.Find(".//option"))
            {
                //Console.WriteLine(optTag.InnerText);
                Report.Info(optTag.InnerText);
                if (optTag.InnerText == argument2)
                {
                    Report.Info("argument matching:: " + argument2);
                    optTag.Selected = true;
                }
            }

            if (argument2 == "On")
            {
                //Report.Info("On RuleStatus : "+argument2);
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Enabled").Checked  = false;       // true - to enable the test cases
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Disabled").Checked = false;
            }
            else if (argument2 == "Off")
            {
                //Report.Info("Off RuleStatus : "+argument2);
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Disabled").Checked = false;
                TestSuite.Current.GetTestCase("Choose_Port_Trigger_Enabled").Checked  = false;
            }
        }