@Override public String getLocation() { return selenium.getLocation(); }
public String getLocation() { return base.getLocation(); }
@Override public String getLocation() { return selenium.getLocation(); }
public String getLocation() { return selenium.getLocation(); }
public String getLocation() { return selenium.getLocation(); }
public String getLocation() { return sel.getLocation(); }
@Override public URL getLocation() { try { return new URL(selenium.getLocation()); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("SeleniumHtmlEvaluator"); sb.append("{location='").append(selenium.getLocation()).append('\''); sb.append('}'); return sb.toString(); }
private String getDomain(final WebDriverUtil wdu) { return wdu.getSelenium().getLocation().replaceAll(".*://[^.]{2,3}", "").replaceAll("\\/.*", ""); }
/** * Write current HTML response data to file. This is not the XML representation, therefore * may be used only after explicit page load. * * @param fileName Target file path * @param escapeHTML HTML output will be escaped if true * @throws FileNotFoundException when file is not available. */ public void dumpSource(final String fileName, final boolean escapeHTML) throws FileNotFoundException { PrintWriter out = new PrintWriter(new FileOutputStream(fileName)); out.println("<!-- Dumped on " + (new SimpleDateFormat()).format(new Date()) + ", URL: " + selenium.getLocation() + " -->"); String source = selenium.getHtmlSource(); if (escapeHTML) { Util util = new Util(); source = util.escapeHTML(source); out.println("<html><body><pre>"); out.println(source); out.println("</pre></body></html>"); } else { out.print(source); } out.flush(); }
@Test public void multiple_pac_fields() { openLinks("PageActivationContext Multiple Demo"); assertText("//span[@id='pacValues']", "zero=NULL, one=NULL, two=NULL"); PacScenario[] scenarios = { new PacScenario("link=Change PAC (null, null, null)", "zero=NULL, one=NULL, two=NULL", "/pacmultipleannotationdemo"), new PacScenario("link=Change PAC (zero, null, null)", "zero=zero, one=NULL, two=NULL", "/pacmultipleannotationdemo/zero"), new PacScenario("link=Change PAC (zero, 1, null)", "zero=zero, one=1, two=NULL", "/pacmultipleannotationdemo/zero/1"), new PacScenario("link=Change PAC (zero, 1, 2.2)", "zero=zero, one=1, two=2.2", "/pacmultipleannotationdemo/zero/1/2.2"), new PacScenario("link=Change PAC (zero, 1, 2.2, 3)", "zero=zero, one=1, two=2.2", "/pacmultipleannotationdemo/zero/1/2.2"), new PacScenario("link=Change PAC (null, null, 2.2)", "zero=NULL, one=NULL, two=2.2", "/pacmultipleannotationdemo/$N/$N/2.2"), new PacScenario("link=Change PAC (zero, null, 2.2)", "zero=zero, one=NULL, two=2.2", "/pacmultipleannotationdemo/zero/$N/2.2"), }; for (PacScenario scenario : scenarios) { clickAndWait(scenario.link); assertText("//span[@id='pacValues']", scenario.expextedPacValues); assertTrue(selenium.getLocation().endsWith(scenario.expectedUri)); } }