Having created a test using our blocks and elements, we can view the code that is generated for the test using the Code View.

To open the code view click the Show code button on the test workspace:

 

 

The code is displayed for the test, selecting a block in our test will highlight the code that relates to the block:

 

 

By changing the Test Framework drop down, code is shown for different Test Frameworks e.g. Mocha:

 

 

Code can be exported from Scriptworks and executed in an IDE or specific Test Framework or Continuous Integration environment e.g. Jenkins.

More on this topic will be available soon.

 

We can run the test code directly from Scriptworks using the Scriptworks selection in the Test Framework drop down. Ensure Scriptworks is selected and hide the code window using the Hide code button:

 

We can now target a specific Browser for replay, using the run settings dropdown next to the play button:

 

The default selection will attempt to run the test in Chrome using a locally hosted Selenium server. See the topic: Scriptworks client installation

 

Additional run settings can be configured in the Run Settings section of the project. Here we can configure target environments, including remote infrastructure, or cloud providers such as Saucelabs or Bitbar.

More on this topic will be available soon.

 

We can confirm the client is installed and up to date prior to execution through the status indicator at the bottom right of the page:

 

An amber indicator shows that whilst the client is running it is not up to date, this can be updated by re-running the install process, see:  Scriptworks client installation

 

Clicking the Play button will execute the test using the desired Run Settings:

 

 

You will notice that the test failed! Let’s investigate why using the results, click on the Session Id for the Test to open more detail:

 

Increase the size of the results section using the resize bar and you can see the failed step:

 

 

Click on the Failed step in the table to highlight it and an automatically captured screenshot is shown in the right hand pane:

 

 

Click on the screenshot image to magnify it:

 

 

Here we can see that the auto-suggestion list has hidden the original button and further investigation using the Selenium output message:

 

WebDriverError - [unknown error: Element <input value="Google Search" aria-label="Google Search" name="btnK" type="submit" jsaction="sf.chk"> is not clickable at point (523, 411). Other element would receive the click: <b>...</b> (Session info: chrome=69.0.3497.100) (Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.13.6 x86_64)]

 

It appears the the element is not clickable having been obscured. Fortunately we can perform a click elsewhere on the page to close the suggestion drop down and pass the test, a short video will show the steps for remedying our failed test:

 

  • Learn a new element, the google logo
  • Add a step to click on the logo, dismissing the suggestion list
  • Re-run the test