Beispiel #1
0
        public void DeselectDropdownValueByTextIWebElementTest()
        {
            var elementActions = new ElementActions(Driver);

            Driver.Url = "http://automate-apps.com/select-multiple-options-from-a-drop-down-list/";
            elementActions.SelectDropdownValueByText(By.XPath("//select[@name='cars']"), "BMW");
            Assert.AreEqual("BMW", elementActions.GetSelectedOption(By.XPath("//select[@name='cars']")).Text, "The selected dropdown values didn't match.");
            elementActions.DeselectDropdownValueByText(Driver.FindElement(By.XPath("//select[@name='cars']")), "BMW");
            Assert.IsNull(elementActions.GetSelectedOption(By.XPath("//select[@name='cars']")), "The selected dropdown option wasn't null.");
        }