Debug selenium java tests in eclipse

There are situation when you don’t get exact result after running your test or getting some unknown error or exception and not much details are there on out put, in that situation you might want to observe the line by line execution of code that you have written,

If you run the code in normal way, you can’t see how each and every line executes, so every good editors has a feature called debug, in which you can navigate through each line of code and verify the variable flow or loopings or the modules that you have written.

 

Debug navigation shortcut keys

F5 – Step into – Steps into the call – goes to the call definition
F6 – Step over – steps over the call – line by line execution
F7 – Step return – steps out to the caller
F8 – resume – resumes the rest of the execution

Watch the demo

Here is a video that explains different options you can perform while in debug mode, do watch for more details

 

Sample code to practice debug –

 

Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *