I'm writing tests on robot Framework and use some python functions with it. So I have the start.sh shell script that runs my testcases. But in my tests I use python functions, that was written by myself and I want to debug it and sometimes see the variables. How can I do it in PyCharm? I tried to add shell script in debug configuration, but it didn't help. Also I tried to run start shell script from python script, but I also couldn't get to breakpoints.
Asked
Active
Viewed 1.3k times
1 Answers
3
Why are you using this start.sh? If you're using PyCharm, you can run your test cases via it and set breakpoints in whatever functions you want. Just setup a configuration for it
I just call run.py for the script: C:\Python27\Lib\site-packages\robot\run.py
Script params: --monitorcolors ansi --loglevel DEBUG --outputdir TestResults --exclude "Exclude_me" TestSuite
Then ensure you have your python interpreter set correctly and your working directory.
This question may also help - HOW TO use Pycharm to debug python script?
-
1I should add those arguments are NOT specfic to what you need, they're just an example. – shicky Feb 12 '16 at 10:20
-
@KseniyaBuraya Question title is not the same as the question details. As according to your question title, you want to debug test cases itself and not the python libraries. – AhmedWas Feb 16 '16 at 10:18
-
1Nothing was mentioned for libraries, test cases will largely be some english language which is actually a wrapper for underlying python functions. The question was clear enough after reading, why the downvotes for my answer which clearly helped!? – shicky Oct 23 '16 at 09:24
-
3@AhmedWas, PyCharm does not allow debugging Robot scripts - only running them as "an external tool". Ant the latter is so user-unfriendly that it's not worth the effort. Besides, using Python-based keywords provides much cleaner test script that using Robot keywords - which are too generic (and not too convenient to use, especially for SW professionals). So your comment - based solely on the virtue of the title, and not the essence of the question - is not helpful. And down-vote is unjustified. I used the same technique - works as (Py)charm :) – volcano Nov 17 '16 at 06:06