方案一:找到该按钮的js方法
代码如下:
WebElement button = webDriver.findElement(By.id("btn_find"));
js.executeScript("SearchData(12)");
如果该按钮没有js方法,那么采用方案
方案二:
by = By.xpath("//*[@id="pollutelist_city"]/a[4]");
ele = wait.until(ExpectedConditions.presenceOfElementLocated(by));
((JavascriptExecutor)driver).executeScript("arguments[0].click();", ele);
最后
以上就是害羞彩虹最近收集整理的关于处理selenium中click事件的全部内容,更多相关处理selenium中click事件内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复