robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
173 stars 14 forks source link

[QUESTION] #127

Closed extmme closed 1 year ago

extmme commented 1 year ago

Hi there,

I have two questions about RobotCode extension.

  1. Does it provide / support remote debugging?
  2. Does it support to run test with Gherkin Syntax (BDD tests).

Thanks

d-biehl commented 1 year ago

Hello,

  1. Yes it supports remote debugging, on your remote machine you have to install the robotcode.debugger package for instance with pip install robotcode.debugger and on your dev machine where VSCode is running you need to create a "RobotCode: Attach" Launch configuration. Then you need to start robotframework tests with robotcode.debugger <args> instead of robot <args> see also the command line help for robotcode.debugger with the --help argument

  2. What type of Gherkin Syntax do you mean? RobotFramework supports its own Gherkin Syntax with Given, When, Then but this is not a real Gherkin file or do you mean real Gherkin files with features and scenarios and so on?

    • The RobotFramework style Gherkin syntax is fully supported by RobotCode
    • The Gherkin Syntax not at the moment. There is a new feature for RobotFramework in the making to support custom parsers, if this is ready for use then I plan to implement a custom parser that supports real Gherkin files that are executed by RobotFramework and also to implement support for this in RobotCode

Does this answer your questions?

extmme commented 1 year ago

Yes, it does. Thank you. And do you have some official instructions to written down? I have not found it :(

d-biehl commented 1 year ago

What instruction do you need? Because I develop this in my sparetime, there is not much documentation for robotcode, but I work on it ;-)

There are some instruction on the new RobotFramework Docs site.

extmme commented 1 year ago

Ok, thanks a lot :)

extmme commented 1 year ago

Sorry for reopening the question I did install the robotcode.debugger to the remote machine and then at my local machine - in Vs Code I wrote the command robotcode.debugger Tests and I got error. Do not know what I did wrong and where is mistake.

image

And I also tried and used your .json for debugging - and does not seem it run :(... Not sure image

d-biehl commented 1 year ago

No Problem ;-)

How and where did you install it?

Can you run RobotFramework tests? and if so, how do you do it?

d-biehl commented 1 year ago

The Scripts path of your python installation is not in the PATH or you did not activate you virtual environmen correctly, can you run python -m robotcode.debugger?

extmme commented 1 year ago

I did install by pip install robotcode.debugger in the windows server machine (we run tests on these machine with Jenkins)

Yes. I can run test through command line (terminal in VS Code) - robot tests image

I also can run tests via launch.json which I created (run after press keyboard F5) image

And I also can run test via arrow next to the test name :) That all work :-)

extmme commented 1 year ago

I cannot run python -m robotcode.debugger - I get error: Error while finding module specification for 'robotcode.debugger' (ModuleNotFoundError: No module named 'robotcode')

I might have wrong localhost and port pn the .json file. I do not know how to run the debug via this .json file (I thought It will work if I chose the Debug run)...

d-biehl commented 1 year ago

You have to execute the robotcode.debugger on the remote machine and in the Remote Launch config you have to change the host to the hostname of the remote machine...

wait, on the last robocon I presented the remote debugging feature, maybe this helps you a little bit more:

https://youtu.be/tfwd89Am27M?t=3450

just only 5 minutes or so and sorry for my poor english

extmme commented 1 year ago

Thanks for video :) I keep exploring, I think I configurated the VS Code (launch.json) well (local machine), did install the debuger on the remote machine ... need to find out last two pieces of the puzzle ... and I will let you know the results :-)

At your video - did you were conected to the remote machine and you did not run the test from VS code, is that correct?

extmme commented 1 year ago

At your video - did you were conected to the remote machine and you did not run the test from VS code, is that correct?

d-biehl commented 1 year ago

Yes, that is correct. Starting tests on the remote machine is not possible. You have to manually start your tests on the remote machine.

extmme commented 1 year ago

I am getting close (need to my company give me a right to connect the remote machine :-) but in the meantime - found it out for another question :) How can I install the modul debug py for debugging the python kw (like in your video). It was not installed via pip install robotcode.debbuger..

d-biehl commented 1 year ago

Ok,

for installing debugger, see here:

https://pypi.org/project/robotcode-debugger/

extmme commented 1 year ago

Done - it finally works :) Thank you for your support:)

extmme commented 1 year ago

Robotcode debbuger is installed, well but If I want to debug the python keywords as you on the video I used this command robotcode.debugger -w -- -d Result -t TestovaciPripad1 Tests\SadaTestu1.robot (I coppied from you) and got this error

image

d-biehl commented 1 year ago

Yes you have to install debugpy, its optional, see here:

https://pypi.org/project/debugpy/

extmme commented 1 year ago

Ohh, this link is the one :-) Thank you.