コード例 #1
0
        /// <summary>
        /// Click the button to process the creation of the new user or dismiss changes
        ///
        /// </summary>
        /// <param name="bAdd">true to create the new user from the information already field or false to
        /// dismiss the creation and delete the new user line entry</param>
        /// <param name="btnCell"></param>
        /// <param name="bLeftButtons">choose to click the accept/cancel from the left column of the table
        /// or false to use the button from the last colum on the right side</param>
        private void _ClickAddOrCancel(bool bAdd, IWebElement btnCell, bool bLeftButtons = true)
        {
            ReadOnlyCollection <IWebElement> listBtn = btnCell.FindElements(By.XPath(".//button"));

            WebElementHelper.HighlightElement(btnCell);

            if (bAdd)
            {
                IWebElement btn = listBtn[0];
                Assert.IsTrue(listBtn[0].Enabled, "UserCreation: Accept user creation button disabled");
                btn.Click();
            }
            else
            {
                IWebElement btn = listBtn[1];
                Assert.IsTrue(listBtn[1].Enabled, "UserRemoval: Delete user button disabled");
                btn.Click();
            }
        }