Logo QF-Test

The testing tool for people who
are excited by perfection.

 

Free Trial  Download  Buy

Martina Schmid, QFS Director

Subscribe to our Release Notes: Send "Subscribe newsletter" to newsletter@remove-this.qfs.de.

Martina Schmid,
QFS Director

Manual | Tutorial | Standard Library | Release Notes

Release Notes

14
Web testing

QF-Test supports several browsers and is able to control them so that users can record manual interactions with the browser and replay those actions again. To gain full control over the browser QF-Test uses two different approaches which will be explained in the following sections.

Note Both approaches are necessary and they will continue to coexist and be fully maintained. Most browsers can be accessed by only one of the two, the only exceptions are Chrome on Windows and Firefox up to version 43 on Windows and Linux. QF-Test attempts to do the right thing by default but you can take control via the attribute 'Browser connection mode' of the 'Start web engine' node.

14.1
Web testing using QF-Driver connection mode

This approach integrates the locally installed browser into a wrapper-window. This approach is also called embedding. QF-Test natively embeds the browser into its own window, thus gaining access to its automation-interfaces. By using these interfaces QF-Test can listen for events from the browser and is also able to inject events the other way into the browser.

Native embedding of browsers into a separate window is not working satisfactorily for newer browsers and in case of Microsoft Edge this approach cannot work at all. For this reason an alternative mechanism was implemented in QF-Test 4.1. Explanations on this mechanism can be found in the following section.

14.2
Website Testing using WebDriver

4.1+ Given that the existing approach using embedding is not maintained anymore by some browser vendors or is not supported at all, a new mechanism was implemented for QF-Test 4.1 to support future browsers and browser versions. This mechanism uses Selenium WebDriver as a bridge between the browser and QF-Test.

Note The WebDriver connection mode is not yet on par with QF-Driver mode in terms of performance and feature completeness (see subsection 14.2.4). When recording, events may get lost. For the time being we recommend to primarily use QF-Driver mode for recording. Please see the system requirements in section 1.1 for detailed information about which browsers are supported for each connection mode and operating system.

14.2.1
WebDriver in general

WebDriver is slowly evolving into a W3C-standard for interacting with web browsers. (http://www.w3.org/TR/webdriver). WebDriver is a remote control interface that enables introspection and control of browsers, based on a platform and language-neutral wire protocol.

The various browser vendors have agreed on this quasi-standard, so that the WebDriver integration is partly implemented directly by the vendors themselves. Partially the integration is based on plugins, some vendors already include the integration in the default setup of their browsers.

QF-Test uses the WebDriver interfaces to interact with the browser. Since the WebDriver approach is only partially fitting the concepts of QF-Test, its web engine was extended so that most of QF-Test's functionality is also available via WebDriver, including the added benefits like synchronization, abstraction of components etc.

Moreover the QF-Test approach can be combined with already existing Selenium scripts. When using WebDriver mode QF-Test is able to directly execute those in an 'SUT script' node (see section 42.2).

Note If you use the WebDriver mode, you are no longer limited to Firefox if you want to specify a browser installation folder using the attribute 'Directory of browser installation' of the 'Start web engine' node. If no matching browser can be localized in the specified directory, an exception will be thrown. If no directory is specified, QF-Test will try to start a default browser of the given browser type.

Note QF-Test needs to deep inspect the browser content in order to enable the familiar testing features (e.g. event and check recording, feature based component recognition, web and custom resolvers) in WebDriver mode. This might provoke in some browsers a warning based on mixed content display or an untrusted certificate. If this warning or error message only appears while running the web site in testing mode, you can safely ignore it.

14.2.2
WebDriver with Microsoft Edge

Because Microsoft Edge comes without pre-installed WebDriver support, the WebDriver integration needs to be installed manually once.

Please navigate your web browser to the Microsoft WebDriver website and download and install the WebDriver version matching your operating system.

In addition, a loopback exemption needs to be defined for the Edge browser. Windows 10 uses an isolation technology that may prevent requests being sent from Edge to QF-Test. Although this does not always happen, we recommend enabling the loopback before testing with Microsoft Edge.

To enable loopback for Edge, open a command shell with administration rights and execute:

CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"

To disable loopback for Edge, open a command shell with administration rights and execute:

CheckNetIsolation LoopbackExempt -d -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"

Details about for enabling loopback for Windows apps can be found in the Windows Dev Center.

After successful installation you can also use Microsoft Edge as browser in your tests.

14.2.3
WebDriver with Safari

There are two options to use Safari for web testing: By means of the SafariDriver bundled with Safari 10+ on macOS 10.11+, or using a Safari extension. Both methods require a manual user setup.

To activate the Apple SafariDriver, open the Safari Preferences and select "Show Develop menu in menu bar". In this menu, activate the "Allow Remote Automation" option. After that, open a Terminal window and execute once the command /usr/bin/safaridriver -p 0 to authorize the driver.

Note Due to special security restrictions imposed by the Apple SafariDriver, the interaction between QF-Test and Safari is limited in the following ways:

  • Tests can only be replayed but not recorded
  • No hard events are possible
  • Only one browser instance is allowed

For a limited time, it will be possible to control Safari using the Selenium SafariDriver extension. To activate this, select QF-Test in Finder and show the package contents using the context menu. Navigate to the folder Contents/Resources/qftest/qftest-4.2.2/webdriver/mac64 and copy the file SafariDriver.safariextz to a local directory. Then open this file to install the extension. Please uninstall any older version of the extension before.

14.2.4
Known limitations of the WebDriver mode

The WebDriver connection mode is under active development. Due to this, some features known from QF-Driver connection mode are not yet available, mostly due to restrictions of the WebDriver specification.

  • No support of file downloads and HTTP authentication.
  • It is not possible to record or replay HTTP requests directly.
  • wd.getComponent(WebElement) does not work currently on elements in inner frames.
  • Events triggering a page load are sometimes not recorded.
  • Event-Synchronization is in some cases delayed.
14.3
Web-Tests without visible Window

4.2+ Using the WebDriver-connection-mode it is possible to drive Firefox and Chrome in the so called "headless"-mode. In this mode, the browser is started in the background, but without any visible window on the screen. All interactions with the webpage are executed inside this "invisible" window.

To execute an existing web test using the "headless"-mode, simply change the type of browser in the 'Start web engine' step from chrome to headless-chrome or from firefox to headless-firefox. Please note that the "headless"-mode is only supported since Chrome 60 and Firefox 57.

Videos Downloads Documentation Buy Free Trial