C#: Selenium Framework: 4 - controls.cs

Controls.cs

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestFramework
{
    /*
     * Groups:
     *      Controls
     *      Control Templates
     *      Tables : QuickWeb
     * 
     * 
     */

    public class ControlText
    {
        public string id = "";
        public string Control = "text";
        public string Option = "";
    }

    public class ControlSelect
    {
        public string id = "";
        public string Control = "select";
        public string Option = "";
        public Hashtable OptionsList = new Hashtable();
    }

    public class ControlCheckbox
    {
        public string id = "";
        public string Control = "checkbox";
        public string Option = "";

        public Hashtable OptionsList = new Hashtable()
            {
                {"1", ""},
                {"2", ""},
                {"3", ""},
                {"4", ""}
            };
    }

    public class ControlRadio
    {
        public string id = "";
        public string Control = "radio";
        public string Option = "";

        public Hashtable OptionsList = new Hashtable()
            {
                {"1", ""},
                {"2", ""},
                {"3", ""},
                {"4", ""}
            };
    }

    public class ControlButton
    {
        public string id = "";
        public string Control = "button";
        public string Option = "";
    }


    public class PartitionsDi
    {
        public ControlSelect Size = new ControlSelect();

    }

    public class Partitions
    {
        

        public ControlSelect Size = new ControlSelect();
        public ControlSelect FileSys = new ControlSelect();
        public ControlCheckbox New = new ControlCheckbox();
        // WIM Fields

        public ControlSelect Label = new ControlSelect(); 
        public ControlSelect Type = new ControlSelect();
        public ControlCheckbox Active = new ControlCheckbox();
        public ControlSelect WimSrc = new ControlSelect();
        

    }
    /*
     * Table Classes
     * QuickWeb : Submit Page
     */

    public class TblServices
    {
        public ControlText SiNumber = new ControlText()
            {
                id = "siNumber",
                Control = "text",
                Option = "4505zz"
                //id = "xxxxxxx",
                //Control = "xxxx",
                //Option = "xxxxxx"
            };

        public ControlSelect SelectService = new ControlSelect()
            {
                id = "service",
                Control = "select",
                Option = "160",
                OptionsList =
                    {
                        {"Image Validation", "160"},
                        {"Image Validation : Deployment Image", "190"},
                        {"Virus Scan Image", "80"},
                        {"Quick Image", "50"},
                        {"Quick Image & Restore Media", "70"},
                        {"Quick Image : Deployment Image", "195"},
                        {"Restore Media", "80"}
                    }
            };

        public ControlButton BtnGetModules = new ControlButton()
            {
                id = "getModulesButton",
                Control = "button"
            };
        public ControlButton BtnSubmit = new ControlButton()
        {
            id = "submitButton",
            Control = "button"
        };
    }

    public class TblDownloadLocation
    {
        public ControlSelect Location = new ControlSelect()
            {
                id = "cboEngServerName",
                Control = "select",
                Option = "1900",
                OptionsList =
                    {
                        {"AUSPS1CFIDEV04 (validation-primary)", "1900"},
                        {"UKNOWN SERVER", "1800"}
                    }
            };
    }

    public class TblImageOs
    {
        public ControlSelect Os = new ControlSelect()
            {
                id = "cboImageOSID",
                Control = "select",
                Option = "80",
                OptionsList =
                    {
                        {"Windows 2000", "10"},
                        {"Windows XP", "20"},
                        {"Windows Server 2003", "30"},
                        {"Windows Vista", "40"},
                        {"Windows Server 2008", "70"},
                        {"Windows 7", "80"},
                        {"Windows Server 2008 R2", "90"},
                        {"Windows 8", "100"},
                        {"null", "0"}
                    }
            };
    }

    public class TblSubFolder
    {
        public ControlSelect Folder = new ControlSelect()
            {
                id = "cboSubFolder",
                Control = "select",
                Option = @"\original_cust_img\"
            };
    }

    public class TblSelectImage
    {
        public ControlSelect Image = new ControlSelect()
            {
                id = "rdoImageName",
                Control = "radio",
                Option = "win7rtmFIX.GHO"
            };
    }

    public class TblOutputImageType
    {
        public ControlSelect Type = new ControlSelect()
            {
                id = "Image_Format",
                Control = "select",
                Option = "1",
                OptionsList =
                    {
                        {"null", "0"},
                        {"Ghost", "1"},
                        {"WIM", "2"}
                    }
            };
    }

    public class TblCustomPartsDi
    {



        public PartitionsDi[] PartitionsDi2 = new PartitionsDi[4]
            {
                new PartitionsDi(), 
                new PartitionsDi(), 
                new PartitionsDi(), 
                new PartitionsDi()
            };
            //{
            //    {
            //        PartitionsDi2[0].Size.id = "",
            //        PartitionsDi2[0].Size.Control = "",
            //        PartitionsDi2[0].Size.Option = "",
            //        PartitionsDi2[0].Size.id = ""
            //    };
            //};



        //
        //
        // Current functionality to be replaced with an Array of controls
        //
        //

        public ControlText PartCount = new ControlText()
        {
            id = "",
            Control = "text",
            Option = "2"
        };

        public ControlSelect UnitType = new ControlSelect()
        {
            id = "mpUnitType",
            Control = "select",
            Option = "3",
            OptionsList =
                    {
                        {"null", "-1"},
                        {"% (percent)", "1"},
                        {"MB (Megabytes)", "2"},
                        {"GB (Gigabytes)", "3"}
                    }
        };
        public ControlText Part1Size = new ControlText()
            {
                id = "mpSize1",
                Control = "text",
                Option = "50"
            };

        public ControlText Part2Size = new ControlText()
            {
                id = "mpSize2",
                Control = "text",
                Option = "50"
            };

        public ControlText Part3Size = new ControlText()
            {
                id = "mpSize3",
                Control = "text",
                Option = "50"
            };

        public ControlText Part4Size = new ControlText()
            {
                id = "mpSize4",
                Control = "text",
                Option = "50"
            };


    }

    public class TblComputerNameSid
    {
        public ControlRadio Sid = new ControlRadio()
            {
                id = "rdoImgCustOpt",
                Control = "radio",
                Option = "10",
                OptionsList =
                    {
                        // SID, BOTH, NONE???
                        {"Change Computer SID", "20"},
                        {"Change Computer SID and Computer Name", "30"},
                        {"No Image Customization", "10"}
                    }
            };
    }

    public class TblRestoreMedia
    {
        public ControlSelect MediaType = new ControlSelect()
        {
            id = "cboMediaType",
            Control = "select",
            Option = "DVD",
            OptionsList =
                    {
                        {"- Select -", "null"},
                        {"CD", "CD"},
                        {"DVD", "DVD"}
                    }
        };
        
        public ControlText CustomerName = new ControlText()
            {
                id = "txtCustName",
                Control = "text",
                Option = ""
            };

        public ControlText PartNumber = new ControlText()
            {
                id = "txtPartNum",
                Control = "text",
                Option = "12229"
            };

        public ControlSelect Lob = new ControlSelect()
            {
                id = "cboPlatform",
                Control = "select",
                Option = "Desktop",
                OptionsList =
                    {
                        {"null", "- Select -"},
                        {"Desktop", "Desktop"},
                        {"Notebook", "Notebook"},
                        {"Server", "Server"},
                        {"Workstation", "Workstation"}
                    }
            };

        public ControlSelect ChangeSid = new ControlSelect()
            {
                id = "cboRestoreChangeSID",
                Control = "select",
                Option = "false",
                OptionsList =
                    {
                        {"- Select -", "null"},
                        {"Yes", "true"},
                        {"No", "false"}
                    }
            };

        public ControlSelect CustomerKit = new ControlSelect()
            {
                id = "cboCustKit",
                Control = "select",
                Option = "false",
                OptionsList =
                    {
                        {"- Select -", "null"},
                        {"Yes", "true"},
                        {"No", "false"}
                    }
            };

        public ControlCheckbox UploadPickup = new ControlCheckbox()
            {
                id = "cboCustKit",
                Control = "checkbox",
                Option = "true"
            };

        public ControlCheckbox UploadEngServer = new ControlCheckbox()
            {
                id = "chkUploadServer",
                Option = "true",
                Control = "checkbox"
            };


    }

    public class TblCustomParts
    {

        public Partitions[] Partitions2 = new Partitions[7]
            {
                new Partitions(), 
                new Partitions(), 
                new Partitions(), 
                new Partitions(), 
                new Partitions(), 
                new Partitions(), 
                new Partitions()
            };

        public ControlText PartCount = new ControlText()
        {
            id = "",
            Control = "text",
            Option = "2"
        };

        public ControlSelect UtilPartition = new ControlSelect()
        {
            id = "cboUP",
            Control = "select",
            Option = "0",
            OptionsList =
                    {
                        {"No", "0"},
                        {"Yes", "1"},
                    }
        };

        public ControlSelect LeaveUnallocated = new ControlSelect()
            {
                id = "mpLeaveUnallocated",
                Control = "select",
                Option = "0",
                OptionsList =
                    {
                        {"No", "0"},
                        {"Yes", "1"},
                    }
            };

        public ControlSelect UnitType = new ControlSelect()
            {
                id = "mpUnitType",
                Control = "select",
                Option = "3",
                OptionsList =
                    {
                        {"null", "-1"},
                        {"% (percent)", "1"},
                        {"MB (Megabytes)", "2"},
                        {"GB (Gigabytes)", "3"}
                    }
            };


        public ControlText Part1Size = new ControlText()
            {
                id = "mpSize1",
                Control = "text",
                Option = "11"
            };

        public ControlSelect Part1FileSystem = new ControlSelect()
            {
                id = "mpFileSystem1",
                Control = "select",
                Option = "3",
                OptionsList =
                    {
                        {"null", "0"},
                        {"FAT 16", "1"},
                        {"FAT 32", "2"},
                        {"NTFS", "3"}
                    }
            };

        public ControlCheckbox Part1New = new ControlCheckbox()
            {
                id = "mpNew1",
                Control = "checkbox",
                Option = "false"
            };

        public ControlText Part1Label = new ControlText()
        {
            id = "mpLabel1",
            Control = "text",
            Option = "Partition1"
        };

        public ControlSelect Part1Type = new ControlSelect()
        {
            id = "mpType1",
            Control = "select",
            Option = "3",
            OptionsList =
                    {
                        {"1", "Primary"},
                        {"2", "Logical"}
                    }
        };

        public ControlCheckbox Part1Active = new ControlCheckbox()
        {
            id = "mpActive1",
            Control = "checkbox",
            Option = "true"
        };

        public ControlSelect Part1WimSource = new ControlSelect()
        {
            id = "mpWIMSource1",
            Control = "select",
            Option = "1",
            OptionsList =
                    {
                        {"0", "null"},
                        {"1", ""},
                        {"2", ""},
                        {"3", ""}
                    }
        };


        public ControlText Part2Size = new ControlText()
            {
                id = "mpSize2",
                Control = "text",
                Option = "12"
            };

        public ControlSelect Part2FileSystem = new ControlSelect()
            {
                id = "mpFileSystem2",
                Control = "select",
                Option = "3",
                OptionsList =
                    {
                        {"null", "0"},
                        {"FAT 16", "1"},
                        {"FAT 32", "2"},
                        {"NTFS", "3"}
                    }
            };

        public ControlCheckbox Part2New = new ControlCheckbox()
            {
                id = "mpNew2",
                Control = "checkbox",
                Option = "false"
            };


        public ControlText Part2Label = new ControlText()
        {
            id = "mpLabel2",
            Control = "text",
            Option = "Partition2"
        };

        public ControlSelect Part2Type = new ControlSelect()
        {
            id = "mpType2",
            Control = "select",
            Option = "3",
            OptionsList =
                    {
                        {"1", "Primary"},
                        {"2", "Logical"}
                    }
        };

        public ControlCheckbox Part2Active = new ControlCheckbox()
        {
            id = "mpActive2",
            Control = "checkbox",
            Option = "false"
        };

        public ControlSelect Part2WimSource = new ControlSelect()
        {
            id = "mpWIMSource2",
            Control = "select",
            Option = "1",
            OptionsList =
                    {
                        {"0", "null"},
                        {"1", ""},
                        {"2", ""},
                        {"3", ""}
                    }
        };

        public ControlText Part3Size = new ControlText()
            {
                id = "mpSize3",
                Control = "text",
                Option = "13"
            };

        public ControlSelect Part3FileSystem = new ControlSelect()
            {
                id = "mpFileSystem3",
                Control = "select",
                Option = "3",
                OptionsList =
                    {
                        {"null", "0"},
                        {"FAT 16", "1"},
                        {"FAT 32", "2"},
                        {"NTFS", "3"}
                    }
            };

        public ControlCheckbox Part3New = new ControlCheckbox()
            {
                id = "mpNew3",
                Control = "checkbox",
                Option = "false"
            };

        public ControlText Part3Label = new ControlText()
        {
            id = "mpLabel3",
            Control = "text",
            Option = "Partition3"
        };

        public ControlSelect Part3Type = new ControlSelect()
        {
            id = "mpType3",
            Control = "select",
            Option = "3",
            OptionsList =
                    {
                        {"1", "Primary"},
                        {"2", "Logical"}
                    }
        };

        public ControlCheckbox Part3Active = new ControlCheckbox()
        {
            id = "mpActive3",
            Control = "checkbox",
            Option = "false"
        };

        public ControlSelect Part3WimSource = new ControlSelect()
        {
            id = "mpWIMSource3",
            Control = "select",
            Option = "1",
            OptionsList =
                    {
                        {"0", "null"},
                        {"1", ""},
                        {"2", ""},
                        {"3", ""}
                    }
        };

        public ControlText Part4Size = new ControlText()
            {
                id = "mpSize4",
                Control = "text",
                Option = "14"
            };

        public ControlSelect Part4FileSystem = new ControlSelect()
            {
                id = "mpFileSystem4",
                Control = "select",
                Option = "3",
                OptionsList =
                    {
                        {"null", "0"},
                        {"FAT 16", "1"},
                        {"FAT 32", "2"},
                        {"NTFS", "3"}
                    }
            };

        public ControlCheckbox Part4New = new ControlCheckbox()
            {
                id = "mpNew4",
                Control = "checkbox",
                Option = "false"
            };

        public ControlText Part4Label = new ControlText()
        {
            id = "mpLabel4",
            Control = "text",
            Option = "Partition4"
        };

        public ControlSelect Part4Type = new ControlSelect()
        {
            id = "mpType4",
            Control = "select",
            Option = "3",
            OptionsList =
                    {
                        {"1", "Primary"},
                        {"2", "Logical"}
                    }
        };

        public ControlCheckbox Part4Active = new ControlCheckbox()
        {
            id = "mpActive4",
            Control = "checkbox",
            Option = "false"
        };

        public ControlSelect Part4WimSource = new ControlSelect()
        {
            id = "mpWIMSource4",
            Control = "select",
            Option = "1",
            OptionsList =
                    {
                        {"0", "null"},
                        {"1", ""},
                        {"2", ""},
                        {"3", ""}
                    }
        };

        public ControlText Part5Size = new ControlText()
            {
                id = "mpSize5",
                Control = "text",
                Option = "15"
            };

        public ControlSelect Part5FileSystem = new ControlSelect()
            {
                id = "mpFileSystem5",
                Control = "select",
                Option = "3",
                OptionsList =
                    {
                        {"null", "0"},
                        {"FAT 16", "1"},
                        {"FAT 32", "2"},
                        {"NTFS", "3"}
                    }
            };

        public ControlCheckbox Part5New = new ControlCheckbox()
            {
                id = "mpNew5",
                Control = "checkbox",
                Option = "false"
            };

        public ControlText Part5Label = new ControlText()
        {
            id = "mpLabel5",
            Control = "text",
            Option = "Partition5"
        };

        public ControlSelect Part5Type = new ControlSelect()
        {
            id = "mpType5",
            Control = "select",
            Option = "3",
            OptionsList =
                    {
                        {"1", "Primary"},
                        {"2", "Logical"}
                    }
        };

        public ControlCheckbox Part5Active = new ControlCheckbox()
        {
            id = "mpActive5",
            Control = "checkbox",
            Option = "false"
        };

        public ControlSelect Part5WimSource = new ControlSelect()
        {
            id = "mpWIMSource5",
            Control = "select",
            Option = "1",
            OptionsList =
                    {
                        {"0", "null"},
                        {"1", ""},
                        {"2", ""},
                        {"3", ""}
                    }
        };
        public ControlText Part6Size = new ControlText()
            {
                id = "mpSize6",
                Control = "text",
                Option = "16"
            };

        public ControlSelect Part6FileSystem = new ControlSelect()
            {
                id = "mpFileSystem6",
                Control = "select",
                Option = "3",
                OptionsList =
                    {
                        {"null", "0"},
                        {"FAT 16", "1"},
                        {"FAT 32", "2"},
                        {"NTFS", "3"}
                    }
            };

        public ControlCheckbox Part6New = new ControlCheckbox()
            {
                id = "mpNew6",
                Control = "checkbox",
                Option = "false"
            };

        public ControlText Part6Label = new ControlText()
        {
            id = "mpLabel6",
            Control = "text",
            Option = "Partition6"
        };

        public ControlSelect Part6Type = new ControlSelect()
        {
            id = "mpType6",
            Control = "select",
            Option = "3",
            OptionsList =
                    {
                        {"1", "Primary"},
                        {"2", "Logical"}
                    }
        };

        public ControlCheckbox Part6Active = new ControlCheckbox()
        {
            id = "mpActive6",
            Control = "checkbox",
            Option = "false"
        };

        public ControlSelect Part6WimSource = new ControlSelect()
        {
            id = "mpWIMSource6",
            Control = "select",
            Option = "1",
            OptionsList =
                    {
                        {"0", "null"},
                        {"1", ""},
                        {"2", ""},
                        {"3", ""}
                    }
        };

        public ControlText Part7Size = new ControlText()
            {
                id = "mpSize7",
                Control = "text",
                Option = "17"
            };

        public ControlSelect Part7FileSystem = new ControlSelect()
            {
                id = "mpNew7",
                Control = "checkbox",
                Option = "false"
            };

        public ControlCheckbox Part7New = new ControlCheckbox()
            {
                id = "mpNew7",
                Control = "checkbox",
                Option = "false",
                OptionsList =
                    {
                        {"null", "0"},
                        {"FAT 16", "1"},
                        {"FAT 32", "2"},
                        {"NTFS", "3"}
                    }
            };

        public ControlText Part7Label = new ControlText()
        {
            id = "mpLabel7",
            Control = "text",
            Option = "Partition7"
        };

        public ControlSelect Part7Type = new ControlSelect()
        {
            id = "mpType7",
            Control = "select",
            Option = "3",
            OptionsList =
                    {
                        {"1", "Primary"},
                        {"2", "Logical"}
                    }
        };

        public ControlCheckbox Part7Active = new ControlCheckbox()
        {
            id = "mpActive7",
            Control = "checkbox",
            Option = "false"
        };

        public ControlSelect Part7WimSource = new ControlSelect()
        {
            id = "mpWIMSource7",
            Control = "select",
            Option = "1",
            OptionsList =
                    {
                        {"0", "null"},
                        {"1", ""},
                        {"2", ""},
                        {"3", ""}
                    }
        };
    }

    public class TblBiosOptions
    {
        public ControlSelect Lob = new ControlSelect()
        {
            id = "BP_BIOSLOB",
            Control = "select",
            Option = "",
            OptionsList =
                    {
                        {"", ""}
                    }
        };

        public ControlSelect OnboardRaid = new ControlSelect()
            {
                id = "BP_ONBOARD_RAID",
                Control = "select",
                Option = "0",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect BootItem1 = new ControlSelect()
            {
                id = "BP_BOOTSEQ_DT1",
                Control = "select",
                Option = "130",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect BootItem2 = new ControlSelect()
            {
                id = "BP_BOOTSEQ_DT2",
                Control = "select",
                Option = "129",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect BootItem3 = new ControlSelect()
            {
                id = "BP_BOOTSEQ_DT3",
                Control = "select",
                Option = "131",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect BootItem4 = new ControlSelect()
            {
                id = "BP_BOOTSEQ_DT4",
                Control = "select",
                Option = "132",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect BootItem5 = new ControlSelect()
            {
                id = "BP_BOOTSEQ_DT5",
                Control = "select",
                Option = "133",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlText SystemPassword = new ControlText()
            {
                id = "FT_SYSTEM_PW",
                Control = "text",
                Option = ""
            };

        public ControlText SetupPassword = new ControlText()
            {
                id = "FT_SETUP_PW",
                Control = "text",
                Option = ""
            };

        public ControlSelect AllowPasswordChanges = new ControlSelect()
            {
                id = "BP_CHANGEPW",
                Control = "select",
                Option = "",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlText AmtPassword = new ControlText()
            {
                id = "FT_AMT_PW",
                Control = "text",
                Option = ""
            };

        public ControlSelect AutoPowerOn = new ControlSelect()
            {
                id = "BP_POWERON_DAYS",
                Control = "select",
                Option = "",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect AutoPowerOnHours = new ControlSelect()
            {
                id = "BP_POWERON_HOUR",
                Control = "select",
                Option = "",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect AutoPowerOnMinutes = new ControlSelect()
            {
                id = "BP_POWERON_MIN",
                Control = "select",
                Option = "",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect LcdBrightnessAc = new ControlSelect()
            {
                id = "BP_LCD_AC",
                Control = "select",
                Option = "",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect LcdBrightnessBattery = new ControlSelect()
            {
                id = "BP_LCD_BATT",
                Control = "select",
                Option = "",
                OptionsList =
                    {
                        {"", ""}
                    }
            };

        public ControlSelect SataOperationMode = new ControlSelect()
            {
                id = "BP_SATA_MODE",
                Control = "select",
                Option = "",
                OptionsList =
                    {
                        {"", ""}
                    }
            };


    }

    public class TblMiscOptions
    {
        public ControlSelect FactoryPatching = new ControlSelect()
            {
                id = "MODD_AUTOMATED_FACTORY_PATCHING",
                Control = "select",
                Option = "1513",
                OptionsList =
                    {
                        {"NO", "1513"},
                        {"YES", "1512"}
                    }
            };

        public ControlSelect InstallDrivers = new ControlSelect()
            {
                id = "MODD_INSTALL_NEEDED_DRIVERS",
                Control = "select",
                Option = "1636",
                OptionsList =
                    {
                        {"null", "-1"},
                        {"NO", "1636"},
                        {"YES", "1637"}
                    }
            };
    }
}
 
Tags