selenium - 如何在黄瓜范围报告中显示动态值
问题描述
我想在黄瓜范围报告中显示动态值
前任:
特征文件
给定输入用户标识为 <"userid">
并输入当前时间为 <"currenttime">
例子:
|用户名 | 当前时间|
|10002 | 今天|
定义文件:
@And("^enter the current time as (.*)")
public void currenttime(String arg1) {
SimpleDateFormat formatter = new SimpleDateFormat("HH:MM");
Date date = new Date();
System.out.println(formatter.format(date));
if (arg1 == "today") {
driver.findElement(By.id("period")).sendKeys(formatter.format(date));
}
}
在黄瓜范围报告中:它只显示“今天”而不是动态值(当前时间=“07:18”)
请指导我..
解决方案
推荐阅读
- c# - 启动时未创建数据库
- reactjs - 无法在 PReact 项目中导入“ag-grid-react”
- java - Spring integration MessagePublishingErrorHandler not being invoked
- hibernate - 使用 nextval 休眠保存
- java - Java 正则表达式处理带有嵌套数据的字符串对象
- javascript - angular 5 build 在 MB 中生成 main.bundle,这会在生产中产生性能问题
- php - PHP/OpenTBS/DocX 嵌套数组/子块
- r - tidyr 仅分离最后 n 个实例
- bash - 如何在 bash printf 的格式字符串中包含破折号?
- html - 是否可以为具有相同类但不同标题标签的不同链接设置样式?