TestLeft UI Spy can generate various code for the object selected in the UI Spy Object Tree. You use the Code Generation Settings dialog to specify how UI Spy should generate code.
To open the dialog, click on the UI Spy toolbar. The dialog lists the available settings and shows a sample code snippet that demonstrates how the selected settings affect the code:
In the dialog —
-
Languages. Select the language you use to write code: C#, VB.NET, or Java.
Note that this setting also specifies the type names that UI Spy displays.
-
The first object. Select the starting object for your object identification code:
Note: This setting does not affect object model code. Option Description Driver The generated code will create a new Driver object and use its Find
method to get the object in the tested application.If you generate code for an object on your local computer, UI Spy will create the
LocalDriver
object.If you generate code for an object on a remote computer, UI Spy will generate the
RemoteDriver
object with the needed parameters automatically.Process / Browser The generated code will get the process or browser object and use its Find
method to get the needed object.Enter the name of the variable that holds the
Driver
object in your test. The generated code will use it to get the browser or process.Main form / Page The generated code will get the application’s topmost window or a web page and use its Find
method to get the needed object.Enter the name of the variable that holds the process or browser whose window or page the code will use. The generated code will use it to get the topmost window or web page.
-
Line breaks. Select a line break style for the generated code.
This setting affects the visual representation of the generated code, it does not affect the code functionality. Choose one or the other option to see how they work.
-
Click OK to apply the changes and close the dialog.
Click Cancel to close the dialog without saving the changes.