Recording a Web UI test
You create a Web UI test in the Web UI Test perspective. HCL OneTest™ UI automatically enables web browsers and configures the test environment before you start recording tests for web applications.
Before you begin
- When recording a test, wait for each page to load completely. This waiting time does not affect performance results because you can remove extra waiting time (think time) when you play back the test.
- If some actions performed in the application under test are missing, you need to select an action in the preferences so that the recorder capture every single action on a web page. To do so, navigate to Record all actions on the page. and select
- Do not change any browser preferences, including JavaScript settings. JavaScript should be enabled to record and play back Web UI scripts in a browser.
- Ensure that you have manually enabled the Safari browser for recording Web UI tests. For instructions, see Enabling Apple Safari for Web UI recording on a Macintosh computer.
- To be able to record a test with Safari, some changes are required:
- In Safari, click the Develop menu and select Allow Remote Automation.
- When the tool starts the Safari browser for recording a test and you enter the application URL, you are prompted with a dialog box. To proceed with the recording of the test, click on Stop Session.
- To record and play back a test with the Mozilla Firefox and Google Chrome browsers on the Mac operating system, ensure that you have installed the browsers at the default location /Applications.
- For Microsoft® Internet Explorer® 9 or later:
- To ensure that the browser always loads the web pages in standard
mode, add
<!DOCTYPE html>
at the beginning of the HTML source of the pages. - To prevent the application from running on a compatibility mode internally, in Internet Explorer, click and clear all of the check boxes.
- If you are recording the test with Internet Explorer 11 for the first time, you have to manually enable the HCL OneTest™ UI extension in the browser. To enable the extension, click Enable on the pop-up that appears the first time you start Internet Explorer after installing HCL OneTest™ UI. You can also open Internet Explorer and click . Then, select RtwIEBhoWithJS Class and click the Enable button.
- To ensure that the browser always loads the web pages in standard
mode, add
- To record a test that emulates a web application on a mobile device, see Recording a test with Google Chrome Device Mode.
- To record a test on Mozilla®
Firefox® browser 54 or later:
- Install the Web UI browser extension for Firefox® 57, see Enabling Mozilla Firefox for Web UI testing for details. This new recommended web extension style is supported from Firefox® 54 and later.
- In the Recorder Settings dialog, check the Use an alternate Firefox profile option and select a user profile that is associated to the extension plug-in.
Before running the Firefox® browser, it is recommended to clear the Firefox® cache. This procedure allows you to run the enabled Firefox® recorder browser extension and to record successful tests.
Certain websites require appropriate certificates to use a proxy recorder to record the site. The recorder certificate is required to record all the secured sites. The client certificate is different and it serves as an additional layer of security that is required by the web server to authenticate the client/browser. If some applications use Secure Sockets Layer (SSL), the proxy recorder can cause authentication problems because SSL relays traffic between the client and the server. Depending on the authentication method in place, the client might require the proxy recorder to authenticate itself as the server, and the server might require the proxy recorder to authenticate as the client. If the client program requires an authenticated server, you must either have access to the server certificate keystore and provide it to the proxy recorder or configure the client to accept the default certificate from the proxy recorder instead of the certificate from the actual server.
Procedure
- In the Web UI Test perspective, click . Alternatively, on the toolbar, click the New Test From Recording icon .
- Click Create a test from a new recording. Select Web UI Test or Create a test from an existing recording, and select a recording session. If you are recording sensitive data, click Recording Encryption Level and select the encryption level to record.
- Optional: If you did not create a test project earlier, click the Create the parent folder icon to create a test project. For more information, see Creating a Test Workbench project.
- Type a name for the test.
- To correlate the test data by using
automatic data correlation, select Customize automatic
data correlation.This option is useful only if you are generating a HTTP test from the Web UI recession file and want to apply data correlation to the HTTP test. Data correlation is not supported for a Web UI test. Click Next.
-
In the Select Client Application page, select the web browser to use and click
Next.
The type of application defines the recorder that can be used. The following client application types are supported for recording a Web UI test:
- Google Chrome
- Mozilla Firefox
- Microsoft Internet Explorer version 9 and later
- Apple Safari
-
In the Recorder Settings dialog, set the recording preferences depending on the browser you
selected:
- If the server requires client SSL authentication, provide the client certificate for the proxy
recorder to be authenticated by the server as though the proxy recorder were the client. Select
The server requires a specific client certificate.
To provide single certificate keystore, specify the file name and password of the server certificate keystore. If multiple certificates are required, click Multiple certificates, and click Add to specify a certificate keystore file name and password for each host name and port.
- If you selected Mozilla Firefox, you can choose to use a temporary Firefox® profile. This option starts Firefox® without any bookmarks, plug-ins, or toolbars that might be associated with your usual profile. Select Use an alternate Firefox profile, and then select Use a temporary Firefox profile.
- If you record a test with the web browser extension that is recommended for Firefox® 57, select a user profile that is associated with the installed extension plug-in. Once this option checked, the web recorder runs the Firefox® web extension to record the test.
- To also include the HTTP traffic in the Web UI recording, click Advanced
and then click Also record HTTP traffic. By using this option, you can later
generate HTTP tests (in addition to the Web UI tests) from the recording.
The option is enabled by default. To disable it, click change default value. In the Preferences dialog, clear Also record HTTP traffic, click Apply and click OK.
- Click Advanced to specify whether to use an HTTP or SOCKS proxy recorder to review and edit network connection settings that the browser uses or to specify advanced SSL authentication settings.
- Specify advanced SSL authentication settings. If you are using the SOCKS recorder, the RptCertificate.jks certificate is used by default. Select The client requires a specific server certificate and click Add to specify the server hostname, port, certificate database path, and the certificate database password for each website that you are planning to test. If you select Generate certificate, for any IP address received by the SOCK proxy that is resolved by one the server hostnames that you listed, the SOCKS proxy uses a generated certificate signed by the RPT certificate authority, thereby ensuring a smooth recording.
- If you select Override browser settings, select Accept SSL 3.0, or Accept TLS 1.0, or both.
- If the server requires client SSL authentication, provide the client certificate for the proxy
recorder to be authenticated by the server as though the proxy recorder were the client. Select
The server requires a specific client certificate.
-
Click Finish.
The Welcome page opens. The page displays the version of the web browser that is launched and also the list of web applications that were added in the instructions provided on the page before proceeding.
- In the browser address field, type the address of the web
application to test.Note: If you enter the address of a secure website (one that starts with https:), your browser might display a security alert. Depending on the security certificate for the site, you might be required to accept a security risk to proceed with the recording.
- After you finish the user tasks in the browser, stop the recorder. You can stop the recorder by closing the web application under test or by clicking the Stop icon in the Recording Control view.
- In the Data Correlation and Transformation page, set the data correlation options as appropriate and click Finish.
What to do next
When the test is generated, you can edit it in the test editor. For information, see Editing Web UI tests.
To create variable data for the test, you can use the dataset candidates suggested by the workbench when you first open the generated test. For more information, see Viewing dataset candidates when you open a test.