Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 运行Python场景outine时出现关键错误_Python 3.x - Fatal编程技术网

Python 3.x 运行Python场景outine时出现关键错误

Python 3.x 运行Python场景outine时出现关键错误,python-3.x,Python 3.x,场景大纲:创建新目标 给定用户已登录 用户打开设置页面 当用户点击目标时 用户点击添加新目标 并使用添加目标详细信息 然后用户单击保存详细信息 然后创建了新的目标 示例: |请求类型| |得到| 我的python函数是 @当(parsers.parse(“添加目标详细信息”)) def添加目标详细信息(请求类型): 等待\直到\元素\出现(“xpath”,Targets.target \名称\字段,0.1) 驱动程序。通过xpath(Targets.target\u name\u字段)查找\u

场景大纲:创建新目标 给定用户已登录 用户打开设置页面 当用户点击目标时 用户点击添加新目标 并使用添加目标详细信息 然后用户单击保存详细信息 然后创建了新的目标 示例: |请求类型| |得到|

我的python函数是

@当(parsers.parse(“添加目标详细信息”)) def添加目标详细信息(请求类型): 等待\直到\元素\出现(“xpath”,Targets.target \名称\字段,0.1) 驱动程序。通过xpath(Targets.target\u name\u字段)查找\u元素。\u。发送\u键(target\u name)

异常获取

======================================================故障=================================== ____________________________测试\u创建\u新标记____________________________

请求=

/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site packages/pytest\u bdd/scenario.py:180:


/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site packages/pytest\u bdd/scenario.py:179:in scenario\u包装器 _执行场景(功能、场景、请求、编码) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site packages/pytest\u bdd/scenario.py:133:in\u execute\u scenario 场景前的request.config.hook.pytest\u bdd\u(request=request,feature=feature,scenario=scenario) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site packages/pluggy/hooks.py:286:incall 返回self._hookexec(self,self.get_hookimpls(),kwargs) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py:93:in\u-hookexec 返回self.\u inner\u hookexec(钩子、方法、kwargs) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py:84:in self._inner_hookexec=lambda hook,methods,kwargs:hook.multicall( /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site packages/pytest\u bdd/plugin.py:62:在pytest\u bdd\u之前的场景中 报告。在场景之前(请求、功能、场景) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site packages/pytest\u bdd/reporting.py:169:in-before\u场景 request.node.场景报告=ScenarioReport(场景=场景,节点=request.node) /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site packages/pytest_bdd/reporting.py:86:ininit self.example_kwargs={


.0=

E键错误:“请求类型”

@pytest.mark.usefixtures(*function_args)
def scenario_wrapper(request):
    _execute_scenario(feature, scenario, request, encoding)
  return fn(*[request.getfixturevalue(arg) for arg in args])
self.example_kwargs = {
  example_param: force_unicode(node.funcargs[example_param])
    for example_param in scenario.get_example_params()
}