Skip to main content

Squish tip of the week: Insert comments while recording


Want to include notes or comments in your script about what you're recording?

While recording, the Control Bar contains an Insert Script Comment button
insertScriptComment

  1. Click the Insert Script Comment button
  2. The Comment Window appearsInsertCommentWindow
  3. Enter a comment and click OK

Once you complete your recording, by clicking Stop, the comment appears within your script. The following example's comment is: # Adding a new entry
[code type="python"]
def main():
startApplication("AddressBookSwing.jar")
activateItem(waitForObjectItem(":Address Book_JMenuBar", "File"))
activateItem(waitForObjectItem(":File_JMenu", "New..."))
activateItem(waitForObjectItem(":Address Book - Unnamed_JMenuBar", "Edit"))
activateItem(waitForObjectItem(":Edit_JMenu", "Add..."))
# Adding a new entry
type(waitForObject(":Address Book - Add.Forename:_JTextField"), "sam")
type(waitForObject(":Address Book - Add.Forename:_JTextField"), "<Tab>")
type(waitForObject(":Address Book - Add.Surname:_JTextField"), "smith")
type(waitForObject(":Address Book - Add.Surname:_JTextField"), "<Tab>")
type(waitForObject(":Address Book - Add.Email:_JTextField"), "sam@smith.com")
type(waitForObject(":Address Book - Add.Email:_JTextField"), "<Tab>")
type(waitForObject(":Address Book - Add.Phone:_JTextField"), "123.123.1234")
clickButton(waitForObject(":Address Book - Add.OK_JButton"))
[/code]

Comments

¨