Although my prefered development solution has already been pointed out on Rustin's DebugBreak() suggestion, and alternate solution is to invoke RunnerW.exe, which requires adding the following line to your target Fitnesse test page
[[Press me to start in remote debug mode][?responder=test&remote_debug=true]]
For the sake of simplicity, I will present a sample fit test header.
So, here is how to Remote Debug using Visual Studio:
Make sure you fitnesse test page starts with the following lines
!define TEST_RUNNER {FitSharp\Runner.exe}
!define REMOTE_DEBUG_RUNNER {FitSharp\RunnerW.exe}
[[Press me to start in remote debug mode][?responder=test&remote_debug=true]]
The rest of your test specification goes here
In Visual Studio, set target code breakpoint
On fit test page, click on Press me to start in remote debug mode, defined above. This starts the RunnerW.exe process (winform app called Fitsharp) which will wait for 30 seconds (I am not sure).
In Visual Studio > Debug menu > Attach to process, locate RunnerW.exe and press Attach button.
On Fitsharp window (RunnerW.exe process), click GO button and you are on your way.
As pratical solution, I use the following strategy:
I create static page called SetupEngine and add the 3 lines stated on previous step 1.
On the top of every test page, I just put the following header, so I don't have to repeat those 3 lines.
!include .SetupEngine
Note that . (dot) on .SetupEngine (which is a path) refers to your Fitnesse root page. You may have to adjust it.
在点击 go 之前,您可以附加到任何进程(如果您使用 VS,则通过调试菜单中的“附加到进程”),并且执行将在设置的断点处暂停。
注意:FitNesse 使用的构建版本必须与您正在调试的代码相同。
您还可以使用远程调试器附加到远程进程。
另外,如果附加 RunnerW.exe 进程,您可以调试装置本身。
Your thinking of using RunnerW.exe as opposed to the Runner.exe.
If you change your test runner to be RunnerW a pop-up window will appear with a 'go' button on it, and will not start the fitnesse test until you hit it.
Before hitting go you can attach to any process (via 'Attach To Process' in the debug menu if your using VS) and the execution will pause at the break points set.
Note: You must have the same build being used by FitNesse as the code you are debugging.
You can also attach to a remote process, using the Remote Debugger.
Also, if you attach the the RunnerW.exe process, you can debug the fixtures themselves.
I haven't had to do it in a while, but the current documentation that comes with FitNesse indicates that you are close. You should be using remote_debug instead of debug.
The best thing is to start with the documentation that comes with your copy of FitNesse, as it matches what you are running. If you are running on port 8080, then the following link should work: http://localhost:8080/FitNesse.UserGuide.DebugingFixtureCode.
Assuming you are using Java, these instructions should help. If you are using a different language I am not sure I can help.
发布评论
评论(5)
要调试 .Net 中的装置,我通常在 C# 装置代码中添加 Debugger.Break()
To debug fixtures in .Net I normally add Debugger.Break() inside my C# fixture code
尽管我首选的开发解决方案已经在 Rustin 的 DebugBreak() 建议 上指出,而替代解决方案是调用 RunnerW.exe,需要将以下行添加到您的目标 Fitnesse 测试页面
请记住,我假设您的测试页面已经定义REMOTE_DEBUG_RUNNER 指向 RunnerW.exe,如 健身指南的自定义测试执行部分
为了简单起见,我将提供一个示例适合性测试标头。
因此,以下是如何使用 Visual Studio 进行远程调试:
作为实用的解决方案,我使用以下策略:
请注意,.SetupEngine(路径)上的.(点)指的是您的 Fitnesse 根页面。你可能需要调整它。
当我提到 Fitnesse.UserGuide 的远程调试部分时,我有了这个想法
希望它有帮助
Although my prefered development solution has already been pointed out on Rustin's DebugBreak() suggestion, and alternate solution is to invoke RunnerW.exe, which requires adding the following line to your target Fitnesse test page
Please, bear in mind that I am assuming your test page already defines REMOTE_DEBUG_RUNNER pointing to RunnerW.exe, as stated in Fitnesse guide's Customizing Test Execution section
For the sake of simplicity, I will present a sample fit test header.
So, here is how to Remote Debug using Visual Studio:
As pratical solution, I use the following strategy:
Note that . (dot) on .SetupEngine (which is a path) refers to your Fitnesse root page. You may have to adjust it.
I had this ideia when I was referring to Fitnesse.UserGuide's remote debug section
Hope it helps
在测试目标位置之前添加以下行
有关更多详细信息,请参阅 Michael Sorens 的优秀文章,关于 Fitnesse 调试技术的最全面的文章。
Add the following line just before the your test target location
For further details, refer to Michael Sorens' excelent article, the most comprehensive article on Fitnesse debug techniques.
您考虑使用 RunnerW.exe 而不是 Runner.exe。
如果您将测试运行程序更改为 RunnerW,则会出现一个弹出窗口,上面有一个“执行”按钮,并且在您点击它之前不会启动适应性测试。
在点击 go 之前,您可以附加到任何进程(如果您使用 VS,则通过调试菜单中的“附加到进程”),并且执行将在设置的断点处暂停。
注意:FitNesse 使用的构建版本必须与您正在调试的代码相同。
您还可以使用远程调试器附加到远程进程。
另外,如果附加 RunnerW.exe 进程,您可以调试装置本身。
Your thinking of using RunnerW.exe as opposed to the Runner.exe.
If you change your test runner to be RunnerW a pop-up window will appear with a 'go' button on it, and will not start the fitnesse test until you hit it.
Before hitting go you can attach to any process (via 'Attach To Process' in the debug menu if your using VS) and the execution will pause at the break points set.
Note: You must have the same build being used by FitNesse as the code you are debugging.
You can also attach to a remote process, using the Remote Debugger.
Also, if you attach the the RunnerW.exe process, you can debug the fixtures themselves.
我已经有一段时间没有这样做了,但 FitNesse 附带的当前文档表明您已经很接近了。您应该使用remote_debug而不是debug。
最好的办法是从 FitNesse 副本附带的文档开始,因为它与您正在运行的内容相匹配。如果您在端口 8080 上运行,则以下链接应该有效:http://localhost:8080/FitNesse。 UserGuide.DebugingFixtureCode。
假设您使用的是 Java,这些说明应该会有所帮助。如果您使用不同的语言,我不确定我可以提供帮助。
I haven't had to do it in a while, but the current documentation that comes with FitNesse indicates that you are close. You should be using remote_debug instead of debug.
The best thing is to start with the documentation that comes with your copy of FitNesse, as it matches what you are running. If you are running on port 8080, then the following link should work: http://localhost:8080/FitNesse.UserGuide.DebugingFixtureCode.
Assuming you are using Java, these instructions should help. If you are using a different language I am not sure I can help.