简体   繁体   English

来自Pycharm的Debug Robot Framework测试

[英]Debug Robot Framework tests from Pycharm

I'm writing tests on robot Framework and use some python functions with it. 我正在编写机器人框架测试并使用它的一些python函数。 So I have the start.sh shell script that runs my testcases. 所以我有运行我的测试用例的start.sh shell脚本。 But in my tests I use python functions, that was written by myself and I want to debug it and sometimes see the variables. 但在我的测试中,我使用python函数,这是我自己编写的,我想调试它,有时会看到变量。 How can I do it in PyCharm? 我怎么能在PyCharm中做到这一点? I tried to add shell script in debug configuration, but it didn't help. 我尝试在调试配置中添加shell脚本,但它没有帮助。 Also I tried to run start shell script from python script, but I also couldn't get to breakpoints. 我也尝试从python脚本运行启动shell脚本,但我也无法得到断点。

Why are you using this start.sh? 你为什么要用这个start.sh? If you're using PyCharm, you can run your test cases via it and set breakpoints in whatever functions you want. 如果您正在使用PyCharm,您可以通过它运行测试用例并在您想要的任何函数中设置断点。 Just setup a configuration for it 只需为它设置配置

I just call run.py for the script: C:\\Python27\\Lib\\site-packages\\robot\\run.py 我只是为脚本调用run.py:C:\\ Python27 \\ Lib \\ site-packages \\ robot \\ run.py

Script params: --monitorcolors ansi --loglevel DEBUG --outputdir TestResults --exclude "Exclude_me" TestSuite 脚本参数:--monitorcolors ansi --loglevel DEBUG --outputdir TestResults --exclude“Exclude_me”TestSuite

Then ensure you have your python interpreter set correctly and your working directory. 然后确保正确设置了python解释器和工作目录。

This question may also help - HOW TO use Pycharm to debug python script? 这个问题也可能有所帮助 - 如何使用Pycharm来调试python脚本?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM