How to get line number where the error has occurred?

1,055 views
Skip to first unread message

NIKHIL RAJGARHIA

unread,
Feb 2, 2017, 6:30:32 AM2/2/17
to robotframework-users
Hi All,

I am using Eclipse IDE for Robot Framework(RIDE). Is it possible to get the line number (printed in console or in error file) of the Test Case whenever the error is encountered. Currently, We get the 'error log' which details about the keyword where the error has occurred, but, it becomes difficult to scroll down to see the errors if number of Test Cases are big. Having the line numbers printed ,in some other file, will make the debugging fast.

Thanks in advance.

Regards,
Nikhil Kumar

Bryan Oakley

unread,
Feb 2, 2017, 10:05:51 AM2/2/17
to nikhilr...@gmail.com, robotframework-users
No. Unfortunately, the robot parser throws away all line number information. 

--
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-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Tatu Aalto

unread,
Feb 2, 2017, 10:43:29 AM2/2/17
to Bryan Oakley, nikhilr...@gmail.com, robotframework-users
Ugh

But it could be really good feature to have. Perhaps writing issue to the tracker and asking for the enhancement would be good idea. 

-Tatu
Send from my mobile

On Feb 2, 2017 5:05 PM, "Bryan Oakley" <bryan....@gmail.com> wrote:
No. Unfortunately, the robot parser throws away all line number information. 
On Thu, Feb 2, 2017 at 5:30 AM, NIKHIL RAJGARHIA <nikhilr...@gmail.com> wrote:
Hi All,

I am using Eclipse IDE for Robot Framework(RIDE). Is it possible to get the line number (printed in console or in error file) of the Test Case whenever the error is encountered. Currently, We get the 'error log' which details about the keyword where the error has occurred, but, it becomes difficult to scroll down to see the errors if number of Test Cases are big. Having the line numbers printed ,in some other file, will make the debugging fast.

Thanks in advance.

Regards,
Nikhil Kumar

--
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-users+unsubscrib...@googlegroups.com.

To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Bryan Oakley

unread,
Feb 2, 2017, 11:52:41 AM2/2/17
to robotframework-users
I completely agree. It's impossible to create a decent debugger without line number information. I submitted an issue in 2010, and a reference implementation in 2012. The implementation added support in the internal data structures and updated the text parser, but the code was apparently never looked at by the core team.

I even had implemented an interactive debugger using that code years ago. It had a lot of potential, but without line numbers I couldn't release it. <shrug>

Here's the original issue from 2010, which had some interesting early discussions:


It's interesting to see that part of my original argument was that I wanted line numbers so I could build a linter for robot. I eventually built that linter, but had to write my own robot parser in order to do it. 


adam.wyp...@gmail.com

unread,
Feb 3, 2017, 3:48:06 AM2/3/17
to robotframe...@googlegroups.com
Hi Nikhil,

If you are using RED, You can raise a feature request to extend current "Execution View" to provide simple Go To First Fail line button in them. It shouldn't be hard to implement it since RED do not use RF parser and internally has possibility to follow execution order send by listener. I created issue for You: https://github.com/nokia/RED/issues/76 .

Best Regards,
-Adam.

NIKHIL RAJGARHIA

unread,
Feb 3, 2017, 5:52:21 AM2/3/17
to robotframe...@googlegroups.com


On Thursday, February 2, 2017 at 10:22:41 PM UTC+5:30, Bryan Oakley wrote:
I completely agree. It's impossible to create a decent debugger without line number information. I submitted an issue in 2010, and a reference implementation in 2012. The implementation added support in the internal data structures and updated the text parser, but the code was apparently never looked at by the core team.

I even had implemented an interactive debugger using that code years ago. It had a lot of potential, but without line numbers I couldn't release it. <shrug>

Here's the original issue from 2010, which had some interesting early discussions:


It's interesting to see that part of my original argument was that I wanted line numbers so I could build a linter for robot. I eventually built that linter, but had to write my own robot parser in order to do it. 


On Thu, Feb 2, 2017 at 9:43 AM, Tatu Aalto <aalto...@gmail.com> wrote:
Ugh

But it could be really good feature to have. Perhaps writing issue to the tracker and asking for the enhancement would be good idea. 

-Tatu
Send from my mobile
On Feb 2, 2017 5:05 PM, "Bryan Oakley" <bryan....@gmail.com> wrote:
No. Unfortunately, the robot parser throws away all line number information. 
On Thu, Feb 2, 2017 at 5:30 AM, NIKHIL RAJGARHIA <nikhilr...@gmail.com> wrote:
Hi All,

I am using Eclipse IDE for Robot Framework(RIDE). Is it possible to get the line number (printed in console or in error file) of the Test Case whenever the error is encountered. Currently, We get the 'error log' which details about the keyword where the error has occurred, but, it becomes difficult to scroll down to see the errors if number of Test Cases are big. Having the line numbers printed ,in some other file, will make the debugging fast.

Thanks in advance.

Regards,
Nikhil Kumar

--
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-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.

--
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-users+unsub...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.


Hi All,

Thanks for your valuable responses.
 
 @Bryan: As I could understand from your post is that, you have built a code that takes care of this issue? Is it correct can you please guide me on this. I am very new to this framework.

Thanks & Regards,
Nikhil Kumar

NIKHIL RAJGARHIA

unread,
Feb 3, 2017, 5:58:46 AM2/3/17
to robotframework-users
Hi Adam,

Thanks for the valuable response and creating the issue for me.
The issue which you have created, will it take care about the line numbers? As I can understand, this feature will only take me to the file where the error has occurred. What if I have 20-30 TCs in the same file?

Best Regards,
Nikhil Kumar

adam.wyp...@gmail.com

unread,
Feb 4, 2017, 11:19:55 AM2/4/17
to robotframework-users
Hi Nikhil,

Currently with You are able to go to line, where failing TC is declared. With feature request created by me, You will be able to get exactly line inside TC where keyword fail. 

BR,
-Adam.
Reply all
Reply to author
Forward
0 new messages