标签:key 代码 keyword mat javascrip 方式 win nbsp cut
WebDriver driver = new ChromeDriver();
JavascriptExecutor jse = (JavascriptExecutor)driver;
1.直接传入JavaScript代码
jse.executeScript("window.open(‘" + String.format(detailsUrl,urlParam[0],urlParam[1],urlParam[2],urlParam[4],urlParam[3] ) + "‘)");
2.传入WebElement执行JS
WebElement webElement = webDriver.findElement(By.id("tab_2"));
jse.executeScript("arguments[0].click();", webElement);
标签:key 代码 keyword mat javascrip 方式 win nbsp cut
原文地址:http://www.cnblogs.com/shirandedan/p/6679623.html