Welcome to the Ranorex Support Portal

Create tests

In this chapter, you’ll learn how to create tests using the Applitools Eyes integration in Ranorex Studio.

In this chapter

Prepare the test suite


  1. In the test suite view, right-click the test suite and click Add setup. Repeat for Add teardown.

  2. From the module browser, drag and drop the InitializeEyes code module to the setup region and the FinalizeEyes module to the teardown region.

  1. Right-click the test suite and click Global parameters

     

  2. In the dialog that appears, click Auto-create and then Auto-bind.

     

  3. Next to EyesApiKey, enter your Applitools Eyes API key. If you’re using an on-premise installation, enter the URL to the server in ServerURL. You can also define other parameters here, but they are optional. See below for an explanation of what they do.

AppName: Enter the name you want the test to be saved under in the Apps & tests category in Eyes.

EyesBatchId: Enter the ID of a test batch to always pass results to this batch.

ViewPortWidth: Define a custom width in pixels for the Applitools Eyes viewport .

ViewPortHeight: Define a custom height in pixels for the Applitools Eyes viewport.

MatchLevel: Define the match level that will be used. Possible values: Exact, Strict, Layout, Content. Default is Strict.

Build your test


You can now build your test as usual and add visual checks by Applitools Eyes to it. This is done in recording modules through user code methods.

  1. Open the recording you want to add a visual check to.

  2. Drag and drop the repository item you want to check from the repository to the desired position in the action table.

  3. In the context menu that appears, click User code > Select from library.

  4. Double-click the VisualCheckpoint method.

Note Icon

Note

  • You can perform visual checks on any repository item, from complete websites to single buttons.
  • You can add as many visual checks as you like, but each check will take additional time and slow down your tests because image data needs to be passed to Applitools Eyes.
Download

Reference


Find out more about user code methods and the user code library in Ranorex Studio expert > User code library > ⇢ Introduction

Other Applitools user code methods

Aside from VisualCheckpoint, there are several more user code methods you can add to a recording module. Use them to pass custom Applitools Eyes parameters at runtime. These will overrule global parameters you’ve set. Refer to the descriptions in Ranorex to see what they do. To add them:

  1. Open the recording you want to add the method to.

  2. In the action table, click Add new action > User code > Select from library.

  3. Double-click the desired user code method.

  4. In the action table, enter your value for the required argument.

PDF and image file checks


You can also use the Applitools Eyes integration to perform visual regression tests on PDF and image files. There is a special user code method for this purpose.

  1. Open the recording you want to add a file check to.

  2. In the action table, click Add new action > User code > Select from library.

  3. Double-click VisualCheckpoint(String fileORFolderPath).

  4. In the action table, enter the value that points to the file or folder you want to check. The following formats are possible:

  • Absolute, e.g. C:usersuserdocumentsMyPDF.pdf for a single file or C:usersuserdocuments for an entire folder.
  • Relative, e.g. MyPDF.pdf for a single file or documents for an entire folder. Relative paths only work for files and folders in the same location as the test executable.

USERS LOVE US

SUBSCRIBE TO OUR NEWSLETTER

Get the latest test automation information right in your mailbox.

FOLLOW US

© 2024 Ranorex GmbH. All Rights Reserved