Table of contents

Contents



Official Content

In this article, you can find some frequently asked questions (FAQ) about GXtest.

General

1. Can a test be debugged?

Yes. You can use GeneXus debugger and run tests in a "step by step" mode. 

2. Is the "Build" process affected when using or running tests? 

Yes. Test objects are part of the Knowledge Base, which means that running a Build All or Rebuild All process in your KB will include tests.

3. Can batch processes be tested?

Yes. Unit testing capabilities enable batch processes to be tested.

4. Where can GXtest be found?

GXtest 4 has officially been released inside GeneXus 16 upgrades.
If you want to install the latest version of GXtest in a custom GeneXus version, you can download and install it on top. 

5. How can the GXtest version build number be known in advance?

GXtest channel is released over AWS S3 with a "key" version.
You can get the version number by using:  https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGETtagging.html

Building Process

1. Why is a build process triggered before running Unit tests?

Unit Tests are special GeneXus Procedures that need to be generated, so each time you run a test, GeneXus checks if there are modifications.

Only if the test itself or one of its dependencies (generated test Structured Data Type, test Data Provider, and objects) has changed, then it forces building the test case object. This means that objects in the KB will not be generated unless they are referenced by tests that have references pending to be built. 

2. Does the unit test objects modify the original object spec/generation in any way?

No. They are isolated objects that don't change other object behavior. 

UI Automation

1. How are tests run using different browsers?

You can change the default browser on your Knowledge Base Properties or just do it explicitly on your test using the Browsers' domain. I.e.:

&driver.SetBrowser(Browsers.Firefox)

2. How is a test run in a remote browser?

GXtest 4 supports Selenium / WebDriver architecture. You will need to have a Selenium node listening for running tests over some IP/port. Then, just use it on your test:

&driver.SetRemoteWebDriver(url)

3. How is the same test run against different environments / URLs? (ie. dev, staging, pre-prod)

There are 2 ways to do this since the UI test will start running after the Go command:

1- Using the Go command to navigate to different environments:

 &driver.Go("http://stagingenv:port/App/home.aspx") 

2- Or using the "Base URL" property on your KB/Environment in GeneXus IDE, plus using the Go() command with relative paths, like: 

&driver.Go(Home.Link())
&driver.Go("home.aspx") // If the object is not in the same KB as the test

4. How are the right targets (HTML elements) used in a Command?

When simulating user actions over HTML controls, commands need the right target to run against.
Use GXtest Recorder and after recording a test case, you will be able to use command locators in the Target section:

image_2018118153013_1_png

5. Does GXtest4 support Custom Commands (like GXtest v3)?

In older versions of GXtest, there were special commands used to interact with custom HTML elements and JS when it was not possible to use native commands. 

This is no longer needed since GXtest 4 can interact with any HTML element on a webpage, even if they are not GeneXus native web controls. 

6. How are validations added over a webPage?

Use Assertions: when recording a test, by right-clicking over an HTML control:

image_2018118153145_1_png

7. How are test iterations added to use different data inputs and outputs?

You can use a For in the test over a Data Provider or other Data sources to add different interactions. 

8. Can tests using Safari be run, even when the "Browsers" domain's Enum values don't have that option?

Yes. You can run on any browser supported by WebDriver technology. 
To do so, use the SetRemoteWebDriver function to launch your test using a remote browser. 

Last update: November 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant