Recording a Test on Google Chrome

Silk4J supports recording a test on Google Chrome 50 or later. For previous versions of Google Chrome, Silk4J supports only replaying tests and recording locators.

Before you can record a Silk4J test, you must have created a Silk4J project.

Note: You cannot record tests on Google Chrome versions prior to version 50.
To record a new test for a web application on Google Chrome 50 or later:
  1. Select the project to which you want to add the new test.
  2. In the toolbar, click Record Actions.
  3. In the Select Browser dialog box, select the browser that you want to use.
  4. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
  5. Optional: Select an Orientation for the browser window.
  6. Optional: To record WebDriver locators instead of recording Silk4J locators, click WebDriver in the Silk Recorder. This feature is available when recording against one of the following browsers:
    • Microsoft Edge
    • Mozilla Firefox
    • Google Chrome
    • Apple Safari
    For additional information, see Using Selenium WebDriver.
  7. Click Record.
  8. The Interactive Recording window opens and displays the application under test. Perform the actions that you want to record.
    1. Click on the object with which you want to interact. Silk4J performs the default action for the object. If there is no default action, or if you have to insert text or specify parameters, the Choose Action dialog box opens.
    2. Optional: To chose an action for an object, which might not be the default action, right-click on the object. The Choose Action dialog box opens.
    3. Optional: If the action has parameters, type the parameters into the parameter fields. Silk4J automatically validates the parameters.
    4. Click OK to close the Choose Action dialog box. Silk4J adds the action to the recorded actions and replays it on the mobile device or emulator.
    During recording, Silk4J displays the mouse position next to the recording window. You can toggle the location to switch between displaying the absolute mouse position on the device display and the mouse position in relation to the active object. For additional information about the actions available during recording, see Actions Available During Recording.
  9. Click Stop. The Record Complete dialog box opens.
  10. The Source folder field is automatically populated with the source file location for the project that you selected. To use a different source folder, click Select and navigate to the folder that you want to use.
  11. Optional: In the Package text box, specify the package name.
    For example, type: com.example. To use an existing package, click Select and select the package that you want to use.
  12. In the Test class text box, specify the name for the test class.
    To use an existing class, click Select and select the class that you want to use.
  13. In the Test method text box, specify a name for the test method.
  14. Click OK.

Replay the test to ensure that it works as expected. You can modify the test to make changes if necessary.