Esempio n. 1
0
        /// <summary>
        /// This will select an item inside of a select element within a row of a grid
        /// </summary>
        /// <param name="tblElem">You table element that is found within the your Page class. i.e. OP.PendingAcceptanceTbl</param>
        /// <param name="by">Your row element as it exists in your By type. i.e. Bys.CBDObserverPage,PendingAcceptanceTblRowBody"/></param>
        /// <param name="firstColumnCellText">The name of the row. i.e. The exact text from cell inside the first column</param>
        /// <param name="tagNameWhereFirstColCellTextExists">The HTML tag name where the firstColumnCellText exists</param>
        /// <param name="idOfSelElem">The exact text of the ID of the Select Element, however, if your select element is dynamically numbered per row, then only send the text before the number. For example, is the select tag has an ID of "Priority_0", only send "Priority"</param>
        /// <param name="itemToChoose">The exact text of the item you want to choose</param>
        /// <param name="additionalColCellText">(Optional) If the first column in your row does not have to be unique compared to other rows in your table, and you would want to specify an additional column value to find your row, you can do that here. Send the exact text of any other column.</param>
        /// <param name="tagNameWhereAddColCellTextExists">(Optional) The HTML tag name where the additionalColumnCellText exists</param>
        public static void Grid_SelectItemWithinSelElem(IWebElement tblElem, By by, string firstColumnCellText, string tagNameWhereFirstColCellTextExists, string idOfSelElem, string itemToChoose, string additionalColCellText = null, string tagNameWhereAddColCellTextExists = null)
        {
            SelectElement selElem = ElemGet.Grid_GetSelElemInsideRowByID(tblElem, by, firstColumnCellText, tagNameWhereFirstColCellTextExists, idOfSelElem, additionalColCellText, tagNameWhereAddColCellTextExists);

            selElem.SelectByText(itemToChoose);
        }
        /// <summary>
        /// This will select an item inside of a select element within a row of a grid
        /// </summary>
        /// <param name="tblElem">You table element that is found within the your Page class. i.e. OP.PendingAcceptanceTbl</param>
        /// <param name="by">Your row element as it exists in your By type. i.e. Bys.CBDObserverPage,PendingAcceptanceTblRowBody"/></param>
        /// <param name="firstColumnCellText">The name of the row. i.e. The exact text from cell inside the first column</param>
        /// <param name="additionalCellName">Send "null" to this parameter if your table does not allow duplicate rows for the first column. If the first column in your row does not have to be unique compared to other rows in your table, and you would want to specify an additional column value to find your row, you can do that here. Send the exact text of any other column.</param>
        /// <param name="idOfSelElem">The exact text of the ID of the Select Element, however, if your select element is dynamically numbered per row, then only send the text before the number. For example, is the select tag has an ID of "Priority_0", only send "Priority"</param>
        /// <param name="itemToChoose">The exact text of the item you want to choose</param>
        public static void Grid_SelectItemWithinSelElem(IWebElement tblElem, By by, string firstColumnCellText, string additionalCellText, string idOfSelElem, string itemToChoose)
        {
            SelectElement selElem = ElemGet.Grid_GetSelElemInsideRowByID(tblElem, by, firstColumnCellText, additionalCellText, idOfSelElem);

            selElem.SelectByText(itemToChoose);
        }