Forum Discussion

Dave_Gorman's avatar
Dave_Gorman
Occasional Contributor
11 years ago

Breakpoints

Hello,



Is there a way to start a test in the middle of code somewhere. I know how to use the breakpoint to pause at a certain point; but can you start and stop a block of code in the middle and not from the very beginning?



Thanks

Dave
  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor
    Not exactly, but you can right click inside a function/procedure and select "Run current routine".
  • jose_pita's avatar
    jose_pita
    Super Contributor
    yes, you put a breakpoint in the first line of code, after it pauses there, you right-click where you want to go and "set next operation". After that, just push F10 and continue from there



  • jose_pita's avatar
    jose_pita
    Super Contributor
    you can just create small functions in the same file or different files with a lot of functions regarding functionalities or parts of your app.



    It'd be easier to do that as it is also a best-practice in programming, divide to conquer :D



    Just pay atention to one thing, you cannot run script routines/functions if they have parameters, you need  to call them from other functions with no parameters.



    Shout if you need more help!
  • If you are using Keyword Tests, then you can section your code using Group, then right click on a Group label and use "Run Selected Operation".  That will execute just what's in the Group. 



    Group is a good way to organize a long test without affecting the execution.
  • Dave_Gorman's avatar
    Dave_Gorman
    Occasional Contributor
    Cool thanks guys,



    It would be a nice feature if you could set a start and stop point anywhere within the code. If I have a really long test and I just want to test one part I have to take that piece of code and copy it to a new test to save time.



    -Dave