use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class MicroprofileSecureEndpointTest method setup.
@Before
public void setup() throws FileNotFoundException, IOException {
webClient = new WebClient();
correctCreds.addCredentials("mp", "mp");
incorrectCreds.addCredentials("random", "random");
serverBase = ServerOperations.createClientTrustStore(webClient, base, clientKeyStorePath).toString();
}
use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class MicroProfileRestClientIT method testRetry.
@Test
public void testRetry() throws Exception {
Page page = new WebClient().getPage(baseUrl + "/resources/javaee8");
Assert.assertEquals(HttpServletResponse.SC_OK, page.getWebResponse().getStatusCode());
}
use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class SecureCustomHttpListenerTest method setUp.
@BeforeClass
public static void setUp() {
WEB_CLIENT = new WebClient();
WEB_CLIENT.getOptions().setThrowExceptionOnFailingStatusCode(false);
WEB_CLIENT.getOptions().setUseInsecureSSL(true);
}
use of com.gargoylesoftware.htmlunit.WebClient in project Payara by payara.
the class OAuthTest method init.
@Before
public void init() {
webClient = new WebClient();
System.out.println("Set up new WebClient");
}
use of com.gargoylesoftware.htmlunit.WebClient in project chuidiang-ejemplos by chuidiang.
the class JavascriptWithHtmlUnit method main.
public static void main(String[] args) throws Exception {
WebClient webClient = new WebClient();
HtmlPage page = webClient.getPage("file:files/JavascriptWithHtmlUnit.html");
// Sale "hola", puesto que se ha ejecutado el codigo javascript de la pagina
System.out.println(page.getElementById("unDiv").getTextContent());
// Cambiamos el contenido usando funciones est�ndar de javascript en navegador
page.executeJavaScript("document.getElementById(\"unDiv\").innerHTML=\"que tal?\"");
System.out.println(page.getElementById("unDiv").getTextContent());
// Cambiamos el contenido con una funcion javascript definida en la pagina.
page.executeJavaScript("cambia(\"adios\")");
System.out.println(page.getElementById("unDiv").getTextContent());
}
Aggregations