I have a input
<input value="http://change" id="view_data_edit" maxlength="2048" data-bindattr-29="29" class="ie6bug" type="text">
and a button
<button class="atp_button pull-right marginright_17p fontweight_thick" id="submit" data-ember-action="24"><span id="i18n-8">Save</span></button>
I use
final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_52);
webClient.getBrowserVersion().setOnLine(true);
webClient.getBrowserVersion().setBrowserLanguage("ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3");
webClient.setJavaScriptTimeout(20000);
webClient.getOptions().setTimeout(20000);
webClient.waitForBackgroundJavaScript(20000);
webClient.setRefreshHandler(new ImmediateRefreshHandler());
webClient.setAjaxController(new NicelyResynchronizingAjaxController());
webClient.getOptions().setGeolocationEnabled(true);
webClient.getOptions().setRedirectEnabled(true);
webClient.getOptions().setUseInsecureSSL(true);
webClient.getOptions().setCssEnabled(true);
webClient.getOptions().setActiveXNative(true);
webClient.getOptions().setAppletEnabled(true);
webClient.getOptions().setJavaScriptEnabled(true);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
webClient.getOptions().setThrowExceptionOnScriptError(false);
webClient.addRequestHeader("Upgrade-Insecure-Requests", "1");
webClient.addRequestHeader("DNT", "1");
and then after go to the site
final HtmlTextInput url = (HtmlTextInput) advancetr069.getElementById("view_data_edit");
url.setText("http://123453qw");
final HtmlButton save_submit = (HtmlButton) advancetr.getElementById("submit");
final HtmlPage save_submitPage = save_submit.click();
The value in input does't change. I think that this is because button use
data-ember-action
How htmlUnit works with data-ember-action ?
Aucun commentaire:
Enregistrer un commentaire