if (runInPortalEnv) {
webDriver.get(String.format("%s://%s:%s/%s", contextRoot.getProtocol(), contextRoot.getHost(),
contextRoot.getPort(), "portal/classic/showcase"));
JavascriptExecutor js = (JavascriptExecutor) webDriver;
String setTextQuery = "document.querySelector(\"input[id$='portalForm:%s']\").value = '%s';";
js.executeScript(String.format(setTextQuery, "seleniumTestDemo", getDemoName()));
js.executeScript(String.format(setTextQuery, "seleniumTestSample", getSampleName()));
js.executeScript("document.querySelector(\"a[id$='portalForm:redirectToPortlet']\").click()");
} else {
if (layout == ShowcaseLayout.MOBILE) {
webDriver.get(this.contextRoot.toExternalForm() + "mobile/"); // because of '#' in URLs