public void Test002_AddPublicSecurityRole() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Public Security Role'"); var manageRolesPage = new ManageRolesPage(_driver); manageRolesPage.OpenUsingControlPanel(_baseUrl); int itemNumber = manageRolesPage.FindElements(By.XPath(ManageRolesPage.SecurityRolesList)).Count; manageRolesPage.AddNewPublicSecurityRole(_publicRoleName); manageRolesPage.OpenUsingControlPanel(_baseUrl); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list increased by 1"); Assert.That(manageRolesPage.FindElements(By.XPath(ManageRolesPage.SecurityRolesList)).Count, Is.EqualTo(itemNumber + 1), "The security role is not added correctly"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Public is enabled"); Assert.IsTrue( manageRolesPage.ElementPresent( By.XPath("//tr[td[text() = '" + _publicRoleName + "']]/td/img[contains(@id, '_imgApproved')]")), "The public role is not enabled"); }