黄瓜功能文件-重复执行

时间:2019-06-18 06:24:06

标签: groovy cucumber

可以请您调查以下观察结果。当我运行黄瓜功能文件时,它始终运行下面突出显示的部分的组。我已经尝试通过更改文件的标签名称来使用不同的选项。如果我仅保留一个参数,则整个脚本正在执行。

工作方式有些不同,这是否意味着我们需要提供任何 每种情况的连通性,每个参数都需要一个参数

底部是步骤定义的示例参考。

@登录 功能:功能的标题 我想将此模板用于我的功能文件

@ Login1

方案概述:登录XYZ应用程序

给出运行指示器标志

并且用户在XYZ应用程序登录屏幕上

用户在登录名中输入

然后用户在密码中输入

用户单击“确定”按钮

然后用户成功在主屏幕上登录

示例:

| atid | pwd1 | runind |

| nm1013 | test01g |是|

| nm0313 | test02g |是|

@ Login1

方案概要:单击创建查询菜单项

在XYZ主屏幕上提供用户

当用户单击“查询”菜单项

并且选择计费方式应为

然后用户点击标题中的创建查询项

然后它将显示创建查询页面f

示例:

|合同|

| GS00T07NSD0007 |

| GS00T07NSD0007 |

步骤定义

@Given(“running indicator flag (.*)”)
def run_indicator_flag(String ind1) {
println "Passing Indicator " + ind1
}

@And(“User is on GMP Application Login Screen”)
def user_on_GMP_Application_Login_Screen() {
boolean store2a
WebUI.openBrowser(’’)
WebUI.navigateToUrl(‘https://URL’, FailureHandling.STOP_ON_FAILURE)
}

@When(“User enters the (.*) in the Login”)
def user_enter_userid_in_the_Login(String uid) {
WebUI.setText(findTestObject(‘Object Repository/ORTC01/Page_/input_userid’), 
uid, FailureHandling.STOP_ON_FAILURE)
}

@And(“User enters the (.*) in the password”)
def User_enters_the_in_the_password(String pwd5) {
WebUI.setText(findTestObject(‘Object 
Repository/ORTC01/Page_/input_password’), pwd5, 
FailureHandling.STOP_ON_FAILURE)
}

执行日志控制台:

2019-06-19 12:17:33.465 INFO  c.k.k.c.c.keyword.CucumberReporter       - --------------------
2019-06-19 12:17:33.465 INFO  c.k.k.c.c.keyword.CucumberReporter       - START SCENARIO Login into GMPA Application
2019-06-19 12:17:33.466 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP running indicator flag Y
Passing Indicator Y
2019-06-19 12:17:58.585 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ running indicator flag Y
2019-06-19 12:17:58.616 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User is on GMP Application Login Screen
2019-06-19 12:18:04.808 INFO  c.k.k.core.webui.driver.DriverFactory    - Starting 'Chrome' driver
2019-06-19 12:18:04.963 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['platform', 'Windows 7']
2019-06-19 12:18:04.964 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['version', '74.0']
2019-06-19 12:18:04.965 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['browserName', 'Google Chrome']
2019-06-19 12:18:05.317 INFO  c.k.k.core.webui.driver.DriverFactory    - Action delay is set to 0 seconds
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 33671
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1560926899.201][WARNING]: This version of ChromeDriver has not been tested with Chrome version 75.
[1560926899.253][WARNING]: This version of ChromeDriver has not been tested with Chrome version 75.
Jun 19, 2019 12:18:25 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
2019-06-19 12:18:26.232 INFO  c.k.k.core.webui.driver.DriverFactory    - sessionId = 93f73b820a84079c895bb9eae90da6ea
2019-06-19 12:18:26.368 INFO  c.k.k.core.webui.driver.DriverFactory    - browser = Chrome 75.0.3770.90
2019-06-19 12:18:26.369 INFO  c.k.k.core.webui.driver.DriverFactory    - platform = Windows 7
2019-06-19 12:18:26.402 INFO  c.k.k.core.webui.driver.DriverFactory    - seleniumVersion = 3.7.1
2019-06-19 12:18:26.402 INFO  c.k.k.core.webui.driver.DriverFactory    - proxyInformation = ProxyInformation{proxyOption=MANUAL_CONFIG, proxyServerType=HTTP, password=, proxyServerAddress=one.proxy.att.com, proxyServerPort=8080}
false
2019-06-19 12:18:46.489 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User is on GMP Application Login Screen
2019-06-19 12:18:46.491 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User enters the rm0013 in the Login
2019-06-19 12:18:57.000 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User enters the rm0013 in the Login
2019-06-19 12:18:57.003 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User enters the test989g in the password
2019-06-19 12:19:20.123 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User enters the test989g in the password
2019-06-19 12:19:20.125 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User clicks on the ok button
2019-06-19 12:20:02.981 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User clicks on the ok button
2019-06-19 12:20:02.983 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User logged in successful at Home Screen
2019-06-19 12:20:41.107 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User logged in successful at Home Screen
2019-06-19 12:20:41.313 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ SCENARIO Login into GMPA Application
2019-06-19 12:20:41.314 INFO  c.k.k.c.c.keyword.CucumberReporter       - END SCENARIO Login into GMPA Application
2019-06-19 12:20:41.317 INFO  c.k.k.c.c.keyword.CucumberReporter       - --------------------
2019-06-19 12:20:41.317 INFO  c.k.k.c.c.keyword.CucumberReporter       - START SCENARIO Login into GMPA Application
2019-06-19 12:20:41.319 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP running indicator flag Y
Passing Indicator Y
2019-06-19 12:21:06.324 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ running indicator flag Y
2019-06-19 12:21:06.326 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User is on GMP Application Login Screen
2019-06-19 12:21:06.335 WARN  c.k.k.core.webui.driver.DriverFactory    - A browser is already opened. Closing browser and opening a new one
2019-06-19 12:21:08.109 INFO  c.k.k.core.webui.driver.DriverFactory    - Starting 'Chrome' driver
2019-06-19 12:21:08.110 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['platform', 'Windows 7']
2019-06-19 12:21:08.111 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['version', '74.0']
2019-06-19 12:21:08.111 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['browserName', 'Google Chrome']
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 10958
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1560927070.279][WARNING]: This version of ChromeDriver has not been tested with Chrome version 75.
Jun 19, 2019 12:21:12 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
2019-06-19 12:21:12.653 INFO  c.k.k.core.webui.driver.DriverFactory    - sessionId = 2bb804d49468588971ef02783823fda9
2019-06-19 12:21:12.665 INFO  c.k.k.core.webui.driver.DriverFactory    - browser = Chrome 75.0.3770.90
2019-06-19 12:21:12.665 INFO  c.k.k.core.webui.driver.DriverFactory    - platform = Windows 7
2019-06-19 12:21:12.666 INFO  c.k.k.core.webui.driver.DriverFactory    - seleniumVersion = 3.7.1
2019-06-19 12:21:12.666 INFO  c.k.k.core.webui.driver.DriverFactory    - proxyInformation = ProxyInformation{proxyOption=MANUAL_CONFIG, proxyServerType=HTTP, password=, proxyServerAddress=one.proxy.att.com, proxyServerPort=8080}
false
2019-06-19 12:21:27.892 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User is on GMP Application Login Screen
2019-06-19 12:21:27.894 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User enters the rm0013 in the Login
2019-06-19 12:21:33.018 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User enters the rm0013 in the Login
2019-06-19 12:21:33.020 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User enters the test989g in the password

仔细观察-重复运行第二次测试

首次运行1

2019-06-19 12:17:33.465 INFO  c.k.k.c.c.keyword.CucumberReporter       - --------------------
2019-06-19 12:17:33.465 INFO  c.k.k.c.c.keyword.CucumberReporter       - START SCENARIO Login into GMPA Application
2019-06-19 12:17:33.466 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP running indicator flag Y
Passing Indicator Y
2019-06-19 12:17:58.585 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ running indicator flag Y
2019-06-19 12:17:58.616 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User is on GMP Application Login Screen
2019-06-19 12:18:04.808 INFO  c.k.k.core.webui.driver.DriverFactory    - Starting 'Chrome' driver
2019-06-19 12:18:04.963 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['platform', 'Windows 7']
2019-06-19 12:18:04.964 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['version', '74.0']
2019-06-19 12:18:04.965 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['browserName', 'Google Chrome']
2019-06-19 12:18:05.317 INFO  c.k.k.core.webui.driver.DriverFactory    - Action delay is set to 0 seconds
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 33671
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1560926899.201][WARNING]: This version of ChromeDriver has not been tested with Chrome version 75.
[1560926899.253][WARNING]: This version of ChromeDriver has not been tested with Chrome version 75.
Jun 19, 2019 12:18:25 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
2019-06-19 12:18:26.232 INFO  c.k.k.core.webui.driver.DriverFactory    - sessionId = 93f73b820a84079c895bb9eae90da6ea
2019-06-19 12:18:26.368 INFO  c.k.k.core.webui.driver.DriverFactory    - browser = Chrome 75.0.3770.90
2019-06-19 12:18:26.369 INFO  c.k.k.core.webui.driver.DriverFactory    - platform = Windows 7
2019-06-19 12:18:26.402 INFO  c.k.k.core.webui.driver.DriverFactory    - seleniumVersion = 3.7.1
2019-06-19 12:18:26.402 INFO  c.k.k.core.webui.driver.DriverFactory    - proxyInformation = ProxyInformation{proxyOption=MANUAL_CONFIG, proxyServerType=HTTP, password=, proxyServerAddress=one.proxy.att.com, proxyServerPort=8080}
false
2019-06-19 12:18:46.489 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User is on GMP Application Login Screen
2019-06-19 12:18:46.491 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User enters the rm0013 in the Login
2019-06-19 12:18:57.000 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User enters the rm0013 in the Login
2019-06-19 12:18:57.003 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User enters the test989g in the password
2019-06-19 12:19:20.123 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User enters the test989g in the password
2019-06-19 12:19:20.125 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User clicks on the ok button
2019-06-19 12:20:02.981 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User clicks on the ok button
2019-06-19 12:20:02.983 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User logged in successful at Home Screen
2019-06-19 12:20:41.107 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User logged in successful at Home Screen
2019-06-19 12:20:41.313 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ SCENARIO Login into GMPA Application
2019-06-19 12:20:41.314 INFO  c.k.k.c.c.keyword.CucumberReporter       - END SCENARIO Login into GMPA Application

重复运行2

2019-06-19 12:20:41.317 INFO  c.k.k.c.c.keyword.CucumberReporter       - --------------------
2019-06-19 12:20:41.317 INFO  c.k.k.c.c.keyword.CucumberReporter       - START SCENARIO Login into GMPA Application
2019-06-19 12:20:41.319 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP running indicator flag Y
Passing Indicator Y
2019-06-19 12:21:06.324 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ running indicator flag Y
2019-06-19 12:21:06.326 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User is on GMP Application Login Screen
2019-06-19 12:21:06.335 WARN  c.k.k.core.webui.driver.DriverFactory    - A browser is already opened. Closing browser and opening a new one
2019-06-19 12:21:08.109 INFO  c.k.k.core.webui.driver.DriverFactory    - Starting 'Chrome' driver
2019-06-19 12:21:08.110 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['platform', 'Windows 7']
2019-06-19 12:21:08.111 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['version', '74.0']
2019-06-19 12:21:08.111 INFO  c.k.k.c.w.util.WebDriverPropertyUtil     - User set preference: ['browserName', 'Google Chrome']
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 10958
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1560927070.279][WARNING]: This version of ChromeDriver has not been tested with Chrome version 75.
Jun 19, 2019 12:21:12 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
2019-06-19 12:21:12.653 INFO  c.k.k.core.webui.driver.DriverFactory    - sessionId = 2bb804d49468588971ef02783823fda9
2019-06-19 12:21:12.665 INFO  c.k.k.core.webui.driver.DriverFactory    - browser = Chrome 75.0.3770.90
2019-06-19 12:21:12.665 INFO  c.k.k.core.webui.driver.DriverFactory    - platform = Windows 7
2019-06-19 12:21:12.666 INFO  c.k.k.core.webui.driver.DriverFactory    - seleniumVersion = 3.7.1
2019-06-19 12:21:12.666 INFO  c.k.k.core.webui.driver.DriverFactory    - proxyInformation = ProxyInformation{proxyOption=MANUAL_CONFIG, proxyServerType=HTTP, password=, proxyServerAddress=one.proxy.att.com, proxyServerPort=8080}
false
2019-06-19 12:21:27.892 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User is on GMP Application Login Screen
2019-06-19 12:21:27.894 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User enters the rm0013 in the Login
2019-06-19 12:21:33.018 DEBUG c.k.k.c.c.keyword.CucumberReporter       - ✓ User enters the rm0013 in the Login
2019-06-19 12:21:33.020 DEBUG c.k.k.c.c.keyword.CucumberReporter       - STEP User enters the test989g in the password

0 个答案:

没有答案
相关问题