Scenario steps

Delve into the different types of steps you can use in your DogQ testing scenarios. From simple actions like 'Go to URL' and 'Click element', to advanced steps like 'Find element' and 'Type Into'.

Let's take a look at the different Steps available in DogQ. Step represents the single interaction action with the web page.

Use Macro

By selecting this step, you can choose one of the available Macros for this Project to execute a specific set of steps.

Go to

This navigational tool with its two subtypes is used when you need DogQ to either go to a URL or switch between browser tabs.

URL

"Go to URL" step is the beginning of all tests. You specify a URL, e.g., https://dogq.io, and upon executing the test, DogQ will load the page and be ready to interact with its elements.

Tab

There might be cases when user interaction leads to a new browser tab being opened and for DogQ to be able to interact with the elements in a new tab it needs to be navigated there first. To use "Go to Tab" simply insert the number of the tab you want to go to.

Numbering starts from 1 and it's where DogQ operates by default. So, if a new tab has been opened and you want to go there, simply type "2" in the value field.

Check URL

This step type asserts that a specific page/URL was opened in the previous step.

If the current URL at the moment of the step execution is the same as you provided, this step will pass and fail otherwise.

Check path

This step checks the trailing part of the URL(the part after the domain), e.g. if you're at "dogq.io/login" you can simply use "login" as step value.

The search is performed from the end of the path backwards, in a right-to-left manner, i.e. if the path you're testing consists of more than one directory and you're particularly interested in the middle one, you still need to specify the path up to the very end. For example, if you're at "docs.dogq.io/use-cases/component-testing" and you want to make sure that the "use-cases" part is still there, you need to use "use-cases/component-testing" as step value.

"Check path" also supports RegEx for paths containing dynamic pieces, e.g. IDs, query strings, etc. In this example we're at "dogq.io/projects/2342" and want to check that a project page with a 4-digit ID has been opened as a result of one of the previous steps.

In this mode "Check path" will try to make a match by a substring regardless of its position in URL, performing the search from the start, in a left-to-right manner, i.e. it checks not just the trailing part of the URL, but the entire URL.

Remember to enclose your RegEx into "/". Otherwise "Check path" will operate in normal mode, trying to make exact match of the value provided, performing the search right-to-left.

Click element

Use this step to simulate a user clicking on an element. It has multiple subtypes: Left button, Right button, Double click, Hover, By coordinates, and Drag and drop. Selectors are used to locate elements and interact with them.

Selectors in DogQ Cheat Sheet

Label (text) - no special syntax, e.g., Execute

CSS selectors

  • ID - #execute-btn

  • class - .btn-green.btn

  • attribute - [href="/login"]

XPath

  • attribute - //*[@id="execute-btn]

  • text - //*[text()="Execute"]

Left Button Click

Left click is naturally the most common one. It clicks on the element specified via selector, just like a user would click on it with their mouse.

Right Button Click

This variant comes in handy when we need to test JavaScripted custom behavior, e.g., custom context menus, tooltips, etc.

Double Click

As with Right button click, this subtype can be useful for testing element custom behavior implemented with JS.

Hover

This subtype simulates a mouse hovering over the specified element.

By coordinates

With this variant, rather than targeting an element by its selector, you can click a point on a page at the specified coordinates. The input here ix “X, Y” coordinates that are calculated starting from the top left corner of the whole page(not the current viewport).

Drag and drop

This subtype is used for testing drag-and-drop functionality.

To use it:

  1. add a Find element step and specify a selector for the element you want to drag

  2. add a Click element | Drag and drop step after it and specify a selector for the element where you want to drop the dragged element

Click element will try to perform a click on an element, even if it's hidden or disabled. This is done to ensure that users can cover as many cases as possible.

Find element

This step type is used to check that a specific element exists and/or has certain attributes. Oftentimes, It's used to confirm the results of the previous steps.

No element

Use this step to check that a specific element is not present on a page. In terms of selectors, it operates the same way as Find element with the difference in the output result. If a specified element is not found, the step will pass and fail otherwise.

Find input

It behaves the same way as Find element, with the only difference being that it's looking for an "input" element tag so that you can then use a follow-up step called Type into to enter specific text values into input fields.

Type into

Use this step to enter a specific text into the input field found at a previous Find input step.

Type into Random Value

This is one of the alternative modes of Type into tool in which DogQ will generate randomized non-duplicate test data based on the RegEx provided.

To use this:

  1. add Type Into step

  2. type "Random//"

  3. insert your regular expression between slash signs

  4. in the test your RegEx will be substituted with the corresponding random string

In this example, we are using a simple RegEx to test the input field validation.

Every time we run this test, DogQ will generate a random 8-character string of letters and digits, which can be seen in the test run report.

Simulating pressing Enter key on the keyboard

There are cases when certain actions, for example a search on a site or an action confirmation, can only be initiated upon pressing Enter key on the keyboard because there's no dedicated button for it in UI. To simulate pressing Enter, simply add Type into step and use KeyEnter as its value.

Find text

You can use this step to validate whether a specific text is present and visible on a page. For example, you can use it when you want to validate that a particular error message appears.

You need to provide the exact text for this step, and if it is present on this page - this step will pass, and it will fail otherwise.

Upload file

You can use this step to upload a file (max size 10MB) to the site you're testing.

To use this:

  1. click on the highlighted button in the "Upload file" step

  2. follow a dialog window that poped up and select the file in your system

  3. provide a selector of an input[type="file"] element you want to upload your file to

The file you preload to DogQ will only be used in the corresponding step and will be deleted if the step or scenario is deleted.

Please, keep in mind that Upload file may not always produce the expected results when used with hidden and/or heavily customized inputs.

Pause

This test step can be helpful when you need to wait for some element to appear on a page or want to check what will happen after a specific time. You need to provide a number in seconds that a test must wait before going to the next step.

Last updated