/// <summary>
        /// This will click on any button within a row on a table
        /// </summary>
        /// <param name="tblElem">You table element that is found within the your Page class. i.e. OP.PendingAcceptanceTbl</param>
        /// <param name="rowElemBy">Any row on your table, as it exists in your By type. We need to use this to wait for a row before we proceed with the test. i.e. Bys.CBDObserverPage,PendingAcceptanceTblBodyRow"/></param>
        /// <param name="firstColumnCellText">The name of the row. i.e. The exact text from cell inside the first column</param>
        /// <param name="additionalCellText">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="btnText">The exact text from the button you want to click</param>
        public static IWebElement Grid_ClickButtonOrLinkWithinRow(IWebDriver browser, IWebElement tblElem, By rowElemBy, string firstColumnCellText, string additionalCellText, string btnText)
        {
            IWebElement btn = ElemGet.Grid_GetButtonOrLinkInsideRowByText(tblElem, rowElemBy, firstColumnCellText, additionalCellText, btnText);

            ElemSet.ScrollToElement(browser, btn);
            Thread.Sleep(0200);
            btn.Click();
            return(btn);
        }
Esempio n. 2
0
        /// <summary>
        /// This will click on any element within a row on a table
        /// </summary>
        /// <param name="Browser">The driver instance</param>
        /// <param name="tblElem">You table element that is found within the your Page class. i.e. OP.PendingAcceptanceTbl</param>
        /// <param name="rowElemBy">Any row on your table, as it exists in your By type. We need to use this to wait for a row before we proceed with the test. i.e. Bys.CBDObserverPage,PendingAcceptanceTblBodyRow"/></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="btnText">The exact text from the button you want to click</param>
        /// <param name="tagNameWhereButtonExists">The HTML tag name where the firstColumnCellText exists</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 IWebElement Grid_ClickButtonOrLinkWithinRow(IWebDriver browser, IWebElement tblElem, By rowElemBy, string firstColumnCellText, string tagNameWhereFirstColCellTextExists, string btnText, string tagNameWhereButtonExists, string additionalColCellText = null, string tagNameWhereAddColCellTextExists = null)
        {
            IWebElement btnOrLnkElem = ElemGet.Grid_GetButtonOrLinkInsideRowByText(tblElem, rowElemBy, firstColumnCellText, tagNameWhereFirstColCellTextExists, btnText, tagNameWhereButtonExists, additionalColCellText, tagNameWhereAddColCellTextExists);

            ElemSet.ScrollToElement(browser, btnOrLnkElem);
            Thread.Sleep(0200);

            btnOrLnkElem.Click();
            return(btnOrLnkElem);
        }