private void HandleSelectingOptionElement() { if (ElementIsNotSelected()) { var selectElement = new HtmlElement(currentNode.ParentNode, webBrowser); var allOptionElements = selectElement.FindElements(By.TagName("option")).Cast <HtmlElement>(); foreach (var element in allOptionElements) { element.DeleteAttribute("selected"); } SetAttribute("selected", "selected"); } }
private void SelectRadioButton() { var checkedState = currentNode.GetAttributeValue("checked", null); if (string.IsNullOrEmpty(checkedState)) { var documentNode = new HtmlElement(currentNode.OwnerDocument.DocumentNode, webBrowser); var allRadioButtons = documentNode.FindElements(By.Name(GetAttribute("name"))); foreach (HtmlElement element in allRadioButtons) { element.DeleteAttribute("checked"); } SetAttribute("checked", "checked"); return; } DeleteAttribute("checked"); }
private void HandleSelectingOptionElement() { if (ElementIsNotSelected()) { var selectElement = new HtmlElement(currentNode.ParentNode, webBrowser); var allOptionElements = selectElement.FindElements(By.TagName("option")).Cast<HtmlElement>(); foreach (var element in allOptionElements) { element.DeleteAttribute("selected"); } SetAttribute("selected", "selected"); } }