Skip to main content

Quick Start

Learn how to write and run a basic ZWL test using Zylitics IDE.

Before you begin#

  1. Log into Zylitics. If you don't have an account, please request free access to our private beta.

  2. In the project selector page, select or create a new project. If you don't wish to keep the resources created in this tutorial, create a new project and delete it once you're finished.

  3. You must have a few build minutes available in your quota.

Cost#

This tutorial should cost less than 1 build minute.

Write a ZWL test#

  1. From the console, click on IDE.
  2. Once IDE loads, click on New File icon (left to + in a circle icon in below image) and name it my first zwl test (or whatever you feel like). Hit enter to save.
  3. Hover the pointer on the new file. From the set of icons next to the file name, click on Create New Test (look at below image) to create a test. Name the test verify basic functionality of google calculator. Hit enter to save and open new test in editor.

new-test

  1. Write the following ZWL code in editor. If time allows, we suggest you write it by hand and not using copy/paste to get a strong feel of ZWL and the editor.

    openUrl('https://google.com')# Find search box and type querytype(findElement('input[aria-label="Search"]', by.cssSelector), 'calculator', keys.enter)# Find the calculator so that we can limit our further searches only within calculator panel.calculator = findElement('div[role="main"] div[data-async-context="query:calculator"] > :first-child', by.cssSelector)# Keep the calculator buttons we require to press.btn9 = findElementFromElement(calculator, '9', by.text)btnMul = findElementFromElement(calculator, '×', by.text)btnDiv = findElementFromElement(calculator, '÷', by.text)btnEq = findElementFromElement(calculator, '=', by.text)# Keep the result element that shows calculation result.resultEl = findElementFromElement(calculator, 'presentation', by.role)
    # Our first calculation is 9*9clickAll(btn9, btnMul, btn9, btnEq)# Assert the result is 81assertTrue(81 == getElementText(resultEl))
    # Our final calculation is to divide the result by 9 twiceclickAll(btnDiv, btn9, btnDiv, btn9, btnEq)# Assert the result is 1assertTrue(1 == getElementText(resultEl))
    print('Congratulations on writing your first ZWL test successfully!')

Run the newly written test#

  1. Add a new Build Capability. From the top of IDE, click on Edit Menu (titled Edit Capabilities, Configs & Variables) and click on Build Capability. Alternatively, hit Shift + A.
    • In the opened window, click on Add new build capability.
    • To run the test on Windows 10 with chrome, name the capability chrome-win10.
    • Select Windows 10 from the OS menu and preferred chrome version from Browser menu.
    • Hit Save to save and return. Close the window.
  2. From Editor Embedded Output Console, click on the run build icon (titled Run build for this version). This will open up Build Config.
  3. In build config screen, select the Build Capability added in previous step and hit Run Build.
  4. IDE will now find and connect to a VM having the choice of OS and browser. You can keep an eye on the progress in Build Output Console.
  5. Once the VM is allocated and connected, test starts running. You can view live preview and real time output of the test within IDE.
  6. Once test run finishes, open Completed Builds to view the detailed results.

Next steps#

Start from the most important features and elements of Test Runner before learning more about ZWL. Once you've a good grasp of ZWL, learn more about IDE and Test Runner to be able to use Zylitics efficiently.