执行在python中自行中断([错误]用户停止了执行。)

时间:2019-05-26 06:57:36

标签: python python-3.x robotframework

框架:机器人,语言: Python-3.7.1 熟练程度:新手

我想在机器人框架中多次运行特定标签。因此,我使用下面的python标签来运行测试套件。

import sys
from robot import run_cli

class Methods:
    suite = sys.argv[1]
    tag = sys.argv[2]
    count = sys.argv[3]

def run_robot_file(self):
    for i in range(0, int(self.count)):
        run_cli(['--include', self.tag, self.suite + '.robot'])

机器人文件:-

*** Test Cases ***

dryrun
        [Tags]  tag

       log to console  Success

但是python只运行一个标签,并且由于某些未知原因而在标签之间被中断。

错误:-

Dir path>py Methods.py test_sample tag 3
==============================================================================
Test Sample
==============================================================================
dryrun                                                                Success
dryrun                                                                | PASS |
------------------------------------------------------------------------------
Test Sample                                                           | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  <<Dir path>>\output.xml
Log:     <<Dir path>>\log.html
Report:  <<Dir path>>\report.html
***[ ERROR ] Execution stopped by user.***

有人可以帮我知道究竟是什么导致执行停止在中间吗?

注意:如果使用run方法代替run_cli,则不存在此问题

robot.run(self.suite + '.robot', include=[self.tag]) -- import robot

0 个答案:

没有答案