public static void Fetching_Test_Device_Options() { TestDeviceOption_list.Clear(); TestDeviceDefault_list.Clear(); Ranorex.Container TestDevice_Elements = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container[@automationid='PART_ExtendedScrollViewer']/container"; IList <UIAutomation> Elements_List = TestDevice_Elements.FindChildren <UIAutomation>(); for (int i = 0; i <= Elements_List.Count - 1; i++) { if (Elements_List[i].Name == "P1" || Elements_List[i].Name == "P2" || Elements_List[i].Name == "P3" || Elements_List[i].Name == "P4") { string _testdevice_Option = Elements_List[i].Name; _testdevice_Option = _testdevice_Option.Replace("P", "Program "); TestDeviceOption_list.Add(_testdevice_Option); } } IList <ComboBox> Combobox_List = TestDevice_Elements.FindChildren <ComboBox>(); for (int j = 0; j <= Combobox_List.Count - 1; j++) { int _combobox_number = j + 1; Ranorex.ComboBox Comb_Text = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container/combobox[" + _combobox_number + "]"; string _combobox_text = Comb_Text.Text; _combobox_text = _combobox_text.Replace("Full On Gain", "FOG").Replace("Reference Test Gain", "RTG").Replace("Telecoil", "T-Coil"); TestDeviceDefault_list.Add(_combobox_text); } }
public static void RandPick(this Ranorex.ComboBox combobox) { Random randNum = new Random(); int r = randNum.Next(combobox.Items.Count - 1); combobox.Select(combobox.Items[r].Text); }
public static void Select(this Ranorex.ComboBox combobox, string item) { // create button Ranorex.Button mybutton = combobox.FindSingle(combobox.GetPath().ToString() + "/button[@accessiblename='Open' or @text='>']"); mybutton.Click(); // create list item to click on Ranorex.ListItem myList = combobox.FindSingle(String.Format("/list[@controlid='1000']/listitem[@text='{0}']", item)); myList.Click(); }
public static void ClickThis(this Ranorex.ComboBox item) { try { item.Click(); Sleep(); } catch (Exception ex) { throw new Exception("ComboBox Click Failed : " + ex.Message); } }
// public static void ConnectDMRepo() // { // try // { // repo.Application.File.Click(); // Reports.ReportLog("Clicked File Menu Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); // repo.SQLdmDesktopClient.ConnectToSQLDMRepository.Click(); // Reports.ReportLog("Clicked Menuitem ConnectToSQLDMRepository Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); // Ranorex.ComboBox combobox = repo.RepositoryConnectionDialog.AuthenticationDropDownList; // combobox.Click(); // ListItem lst_userItem = combobox.FindSingle<ListItem>("/list/listitem[@text='SQL Server Authentication']"); // lst_userItem.Focus(); // lst_userItem.Click(); // Reports.ReportLog("SQL Server Authentication Selected ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); // repo.RepositoryConnectionDialog.Username.PressKeys(Constants.SqlSystemUser); // Reports.ReportLog("Username : "******"Entered Successfully " , Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); // // repo.RepositoryConnectionDialog.Password.PressKeys(Constants.SqlSystemUserPassword); // Reports.ReportLog("Passsword Entered Successfully " , Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); // repo.RepositoryConnectionDialog.ConnectButton.ClickThis(); // Reports.ReportLog("Clicked Connect Button Successfully ! " , Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); // // if(repo.Application.CaptionText.TextValue.Contains(Constants.SQLdmRepository)) // Reports.ReportLog("Connected to SQLdmRepository Successfully ! " , Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); // else // { // Reports.ReportLog("Failed to connect to SQLdmRepository " , Reports.SQLdmReportLevel.Fail, null, Configuration.Config.TestCaseName); // throw new Exception("Failed to connect to SQLdmRepository "); // } // } // catch(Exception ex) // { // throw new Exception("Failed : ConnectDMRepo : " + ex.Message); // } // } public static void ConnectDMRepo(string userType) { try { repo.Application.File.Click(); Reports.ReportLog("Clicked File Menu Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); repo.SQLdmDesktopClient.ConnectToSQLDMRepository.Click(); Reports.ReportLog("Clicked Menuitem ConnectToSQLDMRepository Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); if (userType.Equals(Constants.SqlUser)) { Ranorex.ComboBox combobox = repo.RepositoryConnectionDialog.AuthenticationDropDownList; combobox.Click(); ListItem lst_userItem = combobox.FindSingle <ListItem>("/list/listitem[@text='SQL Server Authentication']"); lst_userItem.Focus(); lst_userItem.Click(); Reports.ReportLog("SQL Server Authentication Selected ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); repo.RepositoryConnectionDialog.Username.PressKeys(Constants.NewSqlUser); Reports.ReportLog("Username : "******"Entered Successfully ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); repo.RepositoryConnectionDialog.Password.PressKeys(Constants.NewSqlUserPassword); Reports.ReportLog("Passsword Entered Successfully ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } else { Ranorex.ComboBox combobox = repo.RepositoryConnectionDialog.AuthenticationDropDownList; combobox.Click(); ListItem lst_userItem = combobox.FindSingle <ListItem>("/list/listitem[@text='Windows Authentication']"); lst_userItem.Focus(); lst_userItem.Click(); Reports.ReportLog("Windows Authentication Selected ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } repo.RepositoryConnectionDialog.ConnectButton.ClickThis(); Reports.ReportLog("Clicked Connect Button Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); if (repo.Application.CaptionText.TextValue.Contains(Constants.SQLdmRepository)) { Reports.ReportLog("Connected to SQLdmRepository Successfully ! ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } else { Reports.ReportLog("Failed to connect to SQLdmRepository ", Reports.SQLdmReportLevel.Fail, null, Configuration.Config.TestCaseName); throw new Exception("Failed to connect to SQLdmRepository "); } Thread.Sleep(30000); } catch (Exception ex) { throw new Exception("Failed : ConnectDMRepo : " + ex.Message); } }
public static void SelectSqlAuthentication() { try { Ranorex.ComboBox combobox = repo.AddPermissionWizard.ComboBoxUserPageCmbBxAuthentication; combobox.Click(); ListItem lst_userItem = combobox.FindSingle <ListItem>("/list/listitem[@text='SQL Server Authentication']"); lst_userItem.Focus(); lst_userItem.Click(); Reports.ReportLog("SQL Server Authentication Selected ", Reports.SQLdmReportLevel.Success, null, Configuration.Config.TestCaseName); } catch (Exception ex) { throw new Exception("Failed : SelectAuthenticationType : " + ex.Message); } }
public static string Language_Check1(string returnval) { string DefaultSelected=""; Ranorex.ComboBox txtCombobox="/form[@classname='Window' and @orientation='None' and @processname='SmartFit']/container/combobox[1]"; string _Value=txtCombobox.Text; if(_Value=="English") { DefaultSelected="Yes"; } else { DefaultSelected="No"; } return DefaultSelected; Delay.Seconds(2); }
private void EnterUnit(Ranorex.ComboBox item, RepoItemInfo itemInfor, string Unit) { // Enter Loading Dose Unit Report.Log(ReportLevel.Info, "Mouse", "Mouse Left DoubleClick item '" + item + "' at Center.", itemInfor, new RecordItemIndex(14)); item.DoubleClick(); Delay.Milliseconds(200); Report.Log(ReportLevel.Info, "Keyboard", "Key 'Back' Press.", new RecordItemIndex(15)); Keyboard.Press(System.Windows.Forms.Keys.Back, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true); Delay.Milliseconds(0); Report.Log(ReportLevel.Info, "Keyboard", "Key sequence from variable '$Unit'.", new RecordItemIndex(16)); Keyboard.Press(Unit); Delay.Milliseconds(100); Report.Log(ReportLevel.Info, "Keyboard", "Key 'Enter' Press.", new RecordItemIndex(17)); Keyboard.Press(System.Windows.Forms.Keys.Return, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true); Delay.Milliseconds(0); }
public static void Mouse_Clicks() { Ranorex.ComboBox Defaultlanguage_Comb="/form[@classname='Window' and @orientation='None' and @processname='SmartFit']/container/combobox[1]"; Mouse.Click(Defaultlanguage_Comb); // Ranorex.Container txtContainer="/form[@classname='Popup' and @orientation='None' and @processname='SmartFit']/container[@classname='ScrollViewer']"; // IList<ListItem> listCombo=txtContainer.FindChildren<ListItem>(); // for(int i=0;i<=listCombo.Count-1;i++) // { // // } // Ranorex.ListItem EnglishCombo="/form[@classname='Popup' and @orientation='None' and @processname='SmartFit']/container/listitem[1]"; // if(EnglishCombo.Visible==true) // { // // } // else // { // // } }
/// <summary> /// Select Combo Box /// </summary> /// <param name="combobox">Element xpath</param> /// <param name="Option">Value to Select</param> /// <param name="ControlName">logical name of control name</param> public static void selectComboBoxOption(Ranorex.ComboBox combobox, string Option, string ControlName) { int i = 0; Boolean selected = false; try { combobox.Focus(); Mouse.Click(combobox); Delay.Milliseconds(1); while (selected == false) { i = i + 1; combobox.PressKeys(Option); if (combobox.Text.Equals(Option)) { selected = true; Keyboard.Press("{Enter}"); Report.Info(ControlName + " is Selected: " + Option); } else { if (i == 10) { Report.Failure("Given Value is Not Present"); break; } Mouse.Click(combobox); Delay.Milliseconds(5); } } } catch (Exception ex) { Report.Failure("Exception Occurred" + ex.Message); } }
public static void Fetching_UserPreference_DefaultValues(string buildname) { FSW_UserPreference_Default_List.Clear(); int _comboboxCount = 0; int _buttonCount = 0; int _ContainerCount = 0; buildname = buildname.Replace(" ", string.Empty); buildname = buildname.ToLower(); if (buildname.Contains("smartfit")) { Ranorex.Container Container_UserPrefernces = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container[@automationid='PART_ExtendedScrollViewer']"; IList <UIAutomation> C_List = Container_UserPrefernces.FindChildren <UIAutomation>(); for (int i = 0; i <= C_List.Count - 4; i++) { if (C_List[i].ControlType == "ComboBox") { int ComboboxNumber = _comboboxCount + 1; if (ComboboxNumber == 1) { Ranorex.ComboBox seletedcombobox = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/combobox[" + ComboboxNumber + "]"; _comboboxCount++; } else { Ranorex.ComboBox seletedcombobox = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/combobox[" + ComboboxNumber + "]"; if (seletedcombobox.Text == "Fitting Screen: Gain Adjustment") { FSW_UserPreference_Default_List.Add("Fit Screen: Gain Adjustment"); } else if (seletedcombobox.Text == "Enter in Simulation Mode") { FSW_UserPreference_Default_List.Add("Connect Manually"); } else { FSW_UserPreference_Default_List.Add(seletedcombobox.Text); } _comboboxCount++; } } if (C_List[i].ControlType == "Group") { int ContainerNumber = _ContainerCount + 1; Ranorex.Container ContainetTxT = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container[@automationid='PART_ExtendedScrollViewer']/container[" + ContainerNumber + "]"; IList <ComboBox> Container_Combobox = ContainetTxT.FindChildren <ComboBox>(); IList <Button> Container_Button = ContainetTxT.FindChildren <Button>(); if (C_List[i].Name != "Default Environmental Programs:") { FSW_UserPreference_Default_List.Add("Yes"); } for (int j = 0; j <= Container_Combobox.Count - 1; j++) { int j1 = j + 1; Ranorex.ComboBox seletedcombobox = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container[" + ContainerNumber + "]/combobox[" + j1 + "]"; FSW_UserPreference_Default_List.Add(seletedcombobox.Text); } for (int k = 0; k <= Container_Button.Count - 1; k++) { int k1 = k + 1; if (k1 == 1) { Ranorex.Button selectedButton = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container[" + ContainerNumber + "]/button[" + k1 + "]"; // FSW_UserPreference_Default_List.Add(selectedButton.Text); if (selectedButton.Pressed == true) { FSW_UserPreference_Default_List.Add("Yes"); } else { FSW_UserPreference_Default_List.Add("No"); } } if (k1 == 2) { Ranorex.Button selectedButton = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container[" + ContainerNumber + "]/button[" + k1 + "]"; if (selectedButton.Pressed == true) { FSW_UserPreference_Default_List.Add("Yes"); } else { FSW_UserPreference_Default_List.Add("No"); } } } _ContainerCount++; } if (C_List[i].ControlType == "Button") { int ButtonNumber = _buttonCount + 1; Ranorex.Button seletedButton = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/button[" + ButtonNumber + "]"; if (seletedButton.Pressed == true) { FSW_UserPreference_Default_List.Add("Yes"); } else { FSW_UserPreference_Default_List.Add("No"); } _buttonCount++; } } } else if (buildname.Contains("solusmax") || buildname.Contains("audigy")) { Ranorex.Container Container_UserPrefernces = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container[@automationid='PART_ExtendedScrollViewer']"; IList <UIAutomation> C_List = Container_UserPrefernces.FindChildren <UIAutomation>(); for (int i = 0; i <= C_List.Count - 4; i++) { if (C_List[i].ControlType == "ComboBox") { int ComboboxNumber = _comboboxCount + 1; if (ComboboxNumber == 1) { Ranorex.ComboBox seletedcombobox = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/combobox[" + ComboboxNumber + "]"; _comboboxCount++; } else { Ranorex.ComboBox seletedcombobox = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/combobox[" + ComboboxNumber + "]"; if (seletedcombobox.Text == "Fitting Screen: Gain Adjustment") { FSW_UserPreference_Default_List.Add("Fit Screen: Gain Adjustment"); } else if (seletedcombobox.Text == "Enter in Simulation Mode") { FSW_UserPreference_Default_List.Add("Connect Manually"); } else { FSW_UserPreference_Default_List.Add(seletedcombobox.Text); } _comboboxCount++; } } if (C_List[i].ControlType == "Group") { int ContainerNumber = _ContainerCount + 1; Ranorex.Container ContainetTxT = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container[@automationid='PART_ExtendedScrollViewer']/container[" + ContainerNumber + "]"; IList <ComboBox> Container_Combobox = ContainetTxT.FindChildren <ComboBox>(); IList <Button> Container_Button = ContainetTxT.FindChildren <Button>(); if (C_List[i].Name != "Default Environmental Programs:") { FSW_UserPreference_Default_List.Add("Yes"); } for (int j = 0; j <= Container_Combobox.Count - 1; j++) { int j1 = j + 1; Ranorex.ComboBox seletedcombobox = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container[" + ContainerNumber + "]/combobox[" + j1 + "]"; FSW_UserPreference_Default_List.Add(seletedcombobox.Text); } for (int k = 0; k <= Container_Button.Count - 1; k++) { int k1 = k + 1; if (k1 == 1) { Ranorex.Button selectedButton = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container[" + ContainerNumber + "]/button[" + k1 + "]"; // FSW_UserPreference_Default_List.Add(selectedButton.Text); if (selectedButton.Pressed == true) { FSW_UserPreference_Default_List.Add("Yes"); } else { FSW_UserPreference_Default_List.Add("No"); } } if (k1 == 2) { Ranorex.Button selectedButton = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container[" + ContainerNumber + "]/button[" + k1 + "]"; if (selectedButton.Pressed == true) { FSW_UserPreference_Default_List.Add("Yes"); } else { FSW_UserPreference_Default_List.Add("No"); } } } _ContainerCount++; } if (C_List[i].ControlType == "Button") { int ButtonNumber = _buttonCount + 1; Ranorex.Button seletedButton = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/button[" + ButtonNumber + "]"; if (seletedButton.Pressed == true) { FSW_UserPreference_Default_List.Add("Yes"); } else { FSW_UserPreference_Default_List.Add("No"); } _buttonCount++; } } } }
//********************************************************************** /// <summary> /// Form action: VerifyProperty equal, Contains, NotContains. /// </summary> public static void VerifyProperty(LxScriptItem item) { //MessageBox.Show(item.getComponent().ToString()); // The component is lable string testtemp = item.getComponent().ToString(); if (item.getComponent().ToString().IndexOf("Lbl") != -1) { Ranorex.NativeWindow nativeWnd = item.getComponentInfo().CreateAdapter <Ranorex.NativeWindow>(false); string lableText = nativeWnd.WindowText; if (item.getArg2Text() == "Equal") { string abc = item.getArg3Text(); Validate.AreEqual(lableText, item.getArg3Text()); } if (item.getArg2Text() == "Contains") { int iFlag = lableText.IndexOf(item.getArg3Text()); Validate.IsTrue(iFlag != -1); } if (item.getArg2Text() == "NotContains") { int iFlag = lableText.IndexOf(item.getArg3Text()); Validate.IsTrue(iFlag == -1); } return; } if (item.getArg2Text() == "Equal") { Validate.Attribute(item.getComponentInfo(), item.getArgText(), item.getArg3Text()); } if (item.getArg2Text() == "Contains") { Validate.Attribute(item.getComponentInfo(), item.getArgText(), new Regex(Regex.Escape(item.getArg3Text()))); } if (item.getArg2Text() == "NotContains") { Validate.Attribute(item.getComponentInfo(), item.getArgText(), new Regex("^((?!(" + Regex.Escape(item.getArg3Text()) + ")).)*$")); } if (item.getArg2Text() == "ListContains") { bool Resultflag = false; object objComponet = item.getComponent(); Ranorex.ComboBox myComboBox = (Ranorex.ComboBox)(objComponet); Ranorex.Button btn = myComboBox.FindSingle("./button"); btn.Click(); List lst = "/list"; foreach (ListItem lst_item in lst.FindChildren <ListItem>()) { if ((lst_item.Text).Equals(item.getArg3Text())) { Resultflag = true; break; } } btn.Click(); Validate.AreEqual(Resultflag, true); } }
public static void Fetching_WebUpdates_Options(string Buildname) { Buildname = Buildname.Replace(" ", string.Empty); Buildname = Buildname.ToLower(); WebElements_Count.Clear(); WebElements_options.Clear(); DefaultValues_WebElements.Clear(); int checkboxCount = 0; int comboboxCount = 0; int checkboxCount2 = 0; Ranorex.Container WebCon = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container[@automationid='PART_ExtendedScrollViewer']/container"; IList <UIAutomation> WebCon_List = WebCon.FindChildren <UIAutomation>(); for (int i = 0; i <= WebCon_List.Count - 1; i++) { if (WebCon_List[i].ControlType == "CheckBox" || WebCon_List[i].ControlType == "ComboBox") { WebElements_Count.Add(WebCon_List[i].ControlType); } } for (int k = 0; k <= WebElements_Count.Count - 1; k++) { if (WebElements_Count[k] == "CheckBox") { int c3 = checkboxCount2 + 1; Ranorex.CheckBox checkboxData = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container/checkbox[" + c3 + "]"; // WebElements_options.Add(checkboxData); string Checkbox_text = checkboxData.Text; if (Checkbox_text == "Check for updates on a scheduled interval") { // WebElements_options.Add("Check Updates Interval"); WebElements_options.Add("Check For Updates Automatically"); } else if (Checkbox_text == "Always download updates when available") { WebElements_options.Add("Download updates automatically"); } else { WebElements_options.Add(Checkbox_text); } checkboxCount2++; } else if (WebElements_Count[k] == "ComboBox") { if (Buildname.Contains("smartfit") || Buildname.Contains("audigy")) { WebElements_options.Add("Check Updates Interval"); } else if (Buildname.Contains("solusmax")) { WebElements_options.Add("Week"); } // WebElements_options.Add("Check Updates Interval"); } } for (int j = 0; j <= WebElements_Count.Count - 1; j++) { if (WebElements_Count[j] == "CheckBox") { int c1 = checkboxCount + 1; Ranorex.CheckBox txtChecked = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container/checkbox[" + c1 + "]"; if (txtChecked.Checked == true) { DefaultValues_WebElements.Add("Yes"); } else { DefaultValues_WebElements.Add("No"); } checkboxCount++; } else if (WebElements_Count[j] == "ComboBox") { int c2 = comboboxCount + 1; Ranorex.ComboBox txtCombText = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/container/combobox[" + c2 + "]"; DefaultValues_WebElements.Add(txtCombText.Text); comboboxCount++; } } }
public static void Fetching_Machine_Preference() { int _ComboBoxCount = 0; FSW_MachinePreference_List.Clear(); DefaultValues_MachinePreference_List.Clear(); Ranorex.Container Container_Machine_Prefernces = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container[@automationid='PART_ExtendedScrollViewer']"; IList <UIAutomation> Machine_Preferncest_list = Container_Machine_Prefernces.FindChildren <UIAutomation>(); for (int i = 0; i <= Machine_Preferncest_list.Count - 4; i++) { string name = Machine_Preferncest_list[i].Name; if (name != null) { // fswprefernce=fswprefernce.Replace(" ",string.Empty); //name=name.Replace(":",string.Empty); name = name.Replace(":", string.Empty); if (!(name == null || name == "Test" || name == "Parameters" || name == "Yes")) { // FSW_MachinePreference_List.Add(Machine_Preferncest_list[i].Name); if (name == "Pediatric Default Target Rule") { FSW_MachinePreference_List.Add("Default Pediatric Fitting Rule"); } else if (name == "Default Experience") { FSW_MachinePreference_List.Add("Default Experience Level"); } else if (name == "Show GN Online Services System Tray Icon") { FSW_MachinePreference_List.Add("System Tray Visibility"); } else if (name == "Programming Interface") { FSW_MachinePreference_List.Add("Default Programming Interface"); } else { FSW_MachinePreference_List.Add(name); } } } } ElementList_Count.Clear(); for (int j = 0; j <= Machine_Preferncest_list.Count - 4; j++) { string elementname = Machine_Preferncest_list[j].ControlType; if (elementname == "ComboBox" || elementname == "CheckBox" || elementname == "Button") { if (elementname == "Button") { if (Machine_Preferncest_list[j].Name == "Yes") { ElementList_Count.Add(elementname); } } else { ElementList_Count.Add(elementname); } } } for (int k = 0; k <= ElementList_Count.Count - 1; k++) { if (ElementList_Count[k] == "ComboBox") { int m = _ComboBoxCount + 1; // int m= Ranorex.ComboBox Comb_text = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/combobox[" + m + "]"; string defvalue = Comb_text.Text; if (defvalue == "DSLv5 - Pediatric") { DefaultValues_MachinePreference_List.Add("DSLv5b - Pediatric"); } else { DefaultValues_MachinePreference_List.Add(defvalue); } _ComboBoxCount++; } else if (ElementList_Count[k] == "CheckBox" || ElementList_Count[k] == "Button") { if (ElementList_Count[k] == "CheckBox") { Ranorex.CheckBox checkedCondition = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/checkbox[@automationid='PART_UsePinCodeCheckBox']"; if (checkedCondition.Checked == true) { DefaultValues_MachinePreference_List.Add("Yes"); } else { DefaultValues_MachinePreference_List.Add("No"); } } else if (ElementList_Count[k] == "Button") { Ranorex.Button btnpressedCondition = "/form[@classname='Window' and @orientation='None' and @processname='SmartFit' or @processname='SolusMax']/container/button[@automationid='PART_SegmentedToggleButton']"; if (btnpressedCondition.Pressed == true) { DefaultValues_MachinePreference_List.Add("Yes"); } else { DefaultValues_MachinePreference_List.Add("No"); } } } } }