The most of the time while developing tests is spent in the Java editor.
As a test developer, it could be useful to execute some code statements against the currently active device. This can be done via the context menu:
The current line is executed by invoking this command on it, also it's possible to execute multiple lines by selecting them and then invoking the editor context menu.
The main use-case is executing lines operating via
driver. (appium driver) or
client. (SeeTest client), for example:
also, it's possible to perform asserts:
The current restrictions:
- the code lines can be selected from a method body (class or method declarations are not expected)
- complex statements (like
while) are not supported
- some complex expression with java lambdas are not supported
- it's not possible to execute via this functionality lines, invoking private methods from the parent class. For example, in the following code snippet, the lines in the foo method would be possible only after changing the visibility of those methods.