From: RBRi <rb...@us...> - 2019-03-30 13:44:49
|
- Description has changed: Diff: ~~~~ --- old +++ new @@ -7,7 +7,8 @@ HtmlPage nextPage = WEB_CLIENT.getPage(nextURL); WEB_CLIENT.waitForBackgroundJavaScript(1000); HtmlForm nextForm = nextPage.getFirstByXPath("//form[@id='patient_registration']"); - + +~~~ List<HtmlRadioButtonInput> radioButtonsByName = nextForm.getRadioButtonsByName("registration_type"); // radioButtonsByName.get(1).setChecked(true); // nextPage.refresh(); @@ -33,12 +34,11 @@ nextPage.getWebResponse().getContentAsString(); nextPage = (HtmlPage) WEB_CLIENT.getCurrentWindow().getEnclosedPage(); - ======================================================================== + +~~~ +it is always returning the old page as it is without affecting the screen!! +can you please help on why it is not getting changed in the page. - it is always returning the old page as it is without affecting the screen!! - - can you please help on why it is not getting changed in the page. - - Regards, - + Regards, + Ahmad ~~~~ --- ** [bugs:#2009] Clicking Radio button not taking affect** **Status:** open **Group:** 2.33 **Created:** Wed Jan 23, 2019 01:26 PM UTC by Ahmad Massri **Last Updated:** Thu Jan 24, 2019 07:56 AM UTC **Owner:** nobody **Attachments:** - [test.html](https://sourceforge.net/p/htmlunit/bugs/2009/attachment/test.html) (297.9 kB; text/html) Dear Sir, I am trying to select the [Emirates ID ] check box in the attached file using HTMLUnit but it is not working anyway, I have tried many ways to do that but always I have the page not changed. the following is a sample of the code that I am using: HtmlPage nextPage = WEB_CLIENT.getPage(nextURL); WEB_CLIENT.waitForBackgroundJavaScript(1000); HtmlForm nextForm = nextPage.getFirstByXPath("//form[@id='patient_registration']"); ~~~ List<HtmlRadioButtonInput> radioButtonsByName = nextForm.getRadioButtonsByName("registration_type"); // radioButtonsByName.get(1).setChecked(true); // nextPage.refresh(); // HtmlRadioButtonInput checkRadio2 = nextPage.getFirstByXPath("//input[@value='card_number']"); // checkRadio2.setChecked(false); // checkRadio2.removeAttribute("checked"); // HtmlRadioButtonInput checkRadio = nextPage.getFirstByXPath("//input[@value='emirates_id']"); // checkRadio.setChecked(true); // checkRadio.setAttribute("checked", "checked"); // WEB_CLIENT.waitForBackgroundJavaScript(2000); // checkRadio.click(); // WEB_CLIENT.waitForBackgroundJavaScript(2000); List<HtmlLabel> labels = nextPage.getByXPath("//label[@for='registration_type']"); // labels.get(0).setAttribute("class", "radio"); // labels.get(1).setAttribute("class", "radio checked"); // HtmlElement createdElement = (HtmlElement)nextPage.createElement("i"); // createdElement.setAttribute("class", "icon-dot"); // createdElement.setNodeValue("<_moz_generated_content_before>✔</_moz_generated_content_before>"); // HtmlSpan span = (HtmlSpan)nextPage.getFirstByXPath("//label[@id='radio_emirates_id']/span"); // span.appendChild(createdElement); labels.get(1).click(); WEB_CLIENT.waitForBackgroundJavaScript(1000); nextPage.getWebResponse().getContentAsString(); nextPage = (HtmlPage) WEB_CLIENT.getCurrentWindow().getEnclosedPage(); ~~~ it is always returning the old page as it is without affecting the screen!! can you please help on why it is not getting changed in the page. Regards, Ahmad --- Sent from sourceforge.net because htm...@li... is subscribed to https://sourceforge.net/p/htmlunit/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |