期望:点了某个Button,无反应
问题:怎么去验证无反应
WebElement webElement = page.getICORemove(); SeleniumUtil.hover(page.getDriver(), webElement); String beforeStr = (String) SeleniumUtil.getInnerHTML(page.getDriver(), page.getDLGDataColumnSetting()); webElement.click(); String newStr = (String) SeleniumUtil.getInnerHTML(page.getDriver(), page.getDLGDataColumnSetting()); Assert.assertEquals(newStr, beforeStr, "Click Remove,there are some changes.");
public static Object getInnerHTML(WebDriver driver, WebElement el) { String code = "var htmlTag=arguments[0].innerHTML;return htmlTag;"; return ((JavascriptExecutor) driver).executeScript(code, el); }