break point debug in robot

799 views
Skip to first unread message

chuny...@alcatel-sbell.com.cn

unread,
Dec 8, 2013, 10:29:29 PM12/8/13
to robotframe...@googlegroups.com

Issue 1282:

Document how to debug execution with `pdb` in User Guide introduced how to break into debugging in robot.

but I can not make it work.

what I did :

I created a python keyword send_cli_command, and insert syntax "import sys, pdb; pdb.Pdb(stdout=sys.__stdout__).set_trace()" in it.

I run the keyword and expect a break point . but robot did not stop at the point, insteadly, following error was report :

 ERROR Error in file '/repo/root/robot/ATS/TEST/test.txt': Importing test library '/repo/root/robot/ATS/TEST/get_var.py' failed: BdbQuit Traceback (most recent call last): File "/repo/root/robot/ATS/TEST/get_var.py", line 8, in <module> pdb.Pdb(stdout=sys.__stdout__).set_trace() File "/opt/robot/Python-2.7/lib/python2.7/bdb.py", line 53, in trace_dispatch return self.dispatch_return(frame, arg) File "/opt/robot/Python-2.7/lib/python2.7/bdb.py", line 91, in dispatch_return if self.quitting: raise BdbQuit

anyone can help to let me know the correct usage ?

thanks in advance.

Kevin O.

unread,
Dec 9, 2013, 9:37:23 AM12/9/13
to robotframe...@googlegroups.com
If you are using RIDE, you cannot use sys.stdin because it will just cause EOF. Try also setting stdin=sys.__stdin__ as seen in this post:
https://groups.google.com/d/msg/robotframework-users/0SanUNKXiWo/bf4uX3hiEgcJ

GUO Chunyan

unread,
Dec 9, 2013, 8:01:18 PM12/9/13
to korm...@gmail.com, robotframe...@googlegroups.com

Hi:

 

Thanks for your help. But it didn’t work till now. Any more advice?

 

Yes, I am using RIDE. And I attached the test case and error log to display my usage.

 

 

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/groups/opt_out.

Kevin O.

unread,
Dec 9, 2013, 10:26:11 PM12/9/13
to robotframe...@googlegroups.com, korm...@gmail.com
Have you tried running from the command line? When running from RIDE, there is nowhere to get input. I am sure there is a way to get it to work in RIDE, but not sure if it is worth the extra effort.
I was getting the same problem as you without setting stdin when I wrote that linked post - after adding the stdin arg, it worked. Now, trying again, it is working without setting stdin. Strange.

GUO Chunyan

unread,
Dec 10, 2013, 12:08:38 AM12/10/13
to korm...@gmail.com, robotframe...@googlegroups.com

I had tried in pybot command mode. Yes, it work.

 

 

From: robotframe...@googlegroups.com [mailto:robotframe...@googlegroups.com] On Behalf Of Kevin O.
Sent: 2013
1210 11:26
To: robotframe...@googlegroups.com
Cc: korm...@gmail.com
Subject: Re: break point debug in robot

 

Have you tried running from the command line? When running from RIDE, there is nowhere to get input. I am sure there is a way to get it to work in RIDE, but not sure if it is worth the extra effort.

I was getting the same problem as you without setting stdin when I wrote that linked post - after adding the stdin arg, it worked. Now, trying again, it is working without setting stdin. Strange.

--

Reply all
Reply to author
Forward
0 new messages