Testing ZK-based Application with QF Test"

From Documentation
(32 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Template:Smalltalk_Author|
 
{{Template:Smalltalk_Author|
 
|author=Hawk Chen, Engineer, Potix Corporation
 
|author=Hawk Chen, Engineer, Potix Corporation
|date= March, 2015
+
|date= March 12, 2015
|version=QF-Test 4.0.3
+
|version=QF-Test 4.0.3 <br/> ZK 7
 
}}
 
}}
  
 
= Overview =  
 
= Overview =  
  
QF-Test is a GUI testing tool for Java and Web, a previous small talk, [http://books.zkoss.org/wiki/Small_Talks/2014/May/Testing_ZK_Applications_at_Business_Level_with_QF-Test Testing ZK Applications at Business Level with QF-Test], already gives us an overview of the tool. As a team member of ZK I would like to try it out myself and learn how good this product is and understand how it could benefit our users and that is why I started this article. In this article, I will talk about how I tested ZK application with this tool and I will share some useful tips about recording and replaying. I did not have the chance to try out advanced features such as remote execution and reading test data from data sources like Excel files, you can explore them by yourself if you are interested.
+
QF-Test is a GUI testing tool for Java and Web, a previous small talk, [http://books.zkoss.org/wiki/Small_Talks/2014/May/Testing_ZK_Applications_at_Business_Level_with_QF-Test Testing ZK Applications at Business Level with QF-Test], already gives us an overview of the tool. As a team member of ZK, I was interested in trying it out myself and understand how it could benefit our users. This is why I started this article.
  
= How QF Test differs from Other Testing Tools =
+
QF-Test has a complete tutorial and following their tutorial most of the test cases run well. However for some specific user actions manual tweaking is required. In this article, I will focus on sharing these useful tweaking tips especially around recording and replaying. Also, my testing samples are shared in gitlab for your reference. I did not have the chance to try out advanced features such as remote execution and reading test data from data sources like Excel files, you can explore them by yourself if you are interested.
When it comes to test we need to find out what we want to test. Server side logic or client side display? Functional test or stress test? The following tools are popular functional testing tools among the ZK community. <br/>
 
  
[http://www.zkoss.org/product/zats ZATS Mimic] is a unit test library that is designed to test an application's server-side logic during agile development. It plays a complementary role to a GUI (client-side) test tool like Selenium or QF-test.
+
= How It Is Different from Other Testing Tools =
 +
 
 +
When it comes to test we need to think about what we want to test. Server-side logic or client side display? Functional test or stress test? The following tools are popular functional testing tools among the ZK community. <br/>
 +
 
 +
[http://www.zkoss.org/product/zats ZATS Mimic] is a unit test library that is designed to test an application's server-side logic during agile development. It plays a complementary role to a GUI (client-side) test tool like Selenium and QF-test.
  
 
[http://www.seleniumhq.org/ Selenium] might be most users' first choice to perform a browser test against a ZK application as it's something most people are familiar with. However according to [http://books.zkoss.org/wiki/Small_Talks/2013/July/ZK_Testing_with_Selenium_IDE ZK Testing with Selenium IDE], you might need to deal with ID generator and locator by yourself.
 
[http://www.seleniumhq.org/ Selenium] might be most users' first choice to perform a browser test against a ZK application as it's something most people are familiar with. However according to [http://books.zkoss.org/wiki/Small_Talks/2013/July/ZK_Testing_with_Selenium_IDE ZK Testing with Selenium IDE], you might need to deal with ID generator and locator by yourself.
  
[http://sahipro.com/ Sahi] is also a web automation test tool, it provides special functions in Sahi scripting language to identify ZK widget without ID generator. You can learn more from [http://books.zkoss.org/wiki/Small_Talks/2013/October/ZK_Testing_with_Sahi ZK Testing with Sahi].
+
[http://sahipro.com/ Sahi] is also a web automation testing tool, it provides special functions in Sahi scripting language to identify ZK widget without ID generator. You can learn more from [http://books.zkoss.org/wiki/Small_Talks/2013/October/ZK_Testing_with_Sahi ZK Testing with Sahi].
  
[http://www.qfs.de/ QF-Test] <ref>QF-Test official website: http://www.qfs.de/</ref> focuses on creating test cases in a graphical tree, which allows business testers to create and read tests without having much coding knowledge. The special integration for ZK offers an optimized component recognition algorithm, which filters for the most important ZK HTML elements and ZK ids. Due to that special effort for ZK widgets, you can access content of data containers like trees, tables or lists directly by one click without taking care of the internal HTML structure of those widgets. Nevertheless, it's also possible to use XPATH or CSS selectors to determine objects. Find an online video describing QF-Test's approach for component recognition at https://www.youtube.com/watch?v=VE_mJAZpMx0.
+
[http://www.qfs.de/ QF-Test] <ref>QF-Test official website: http://www.qfs.de/</ref> focuses on creating test cases in a graphical tree, which allows business testers to create and read tests without having much coding knowledge. The special integration for ZK offers an optimized component recognition algorithm, which filters for the most important ZK HTML elements and ZK ids. Due to that special effort for ZK widgets, you can access content of data containers like trees, tables or lists directly by one click without having to take care of the internal HTML structure of those widgets. Nevertheless, it's also possible to use XPATH or CSS selectors to determine objects. Find an online video describing QF-Test's approach for component recognition at https://www.youtube.com/watch?v=VE_mJAZpMx0.
  
 
= Record and Replay a Test Case =
 
= Record and Replay a Test Case =
  
The most intuitive way in QF-Test to create a test case is to record your actions on a browser. QF-Test [http://www.qfs.de/en/qftest/tutorial.html tutorial] describes how you can create a test case in details. Here, I just mention a few key points to give a basic idea.
+
The most intuitive way in QF-Test to create a test case is to record your actions on a browser. QF-Test [http://www.qfs.de/en/qftest/tutorial.html tutorial] describes how you can create a test case in details. For step-by-step setup, please reference their tutorial. Here, I just mention a few key points to give you a basic idea about the record and replay process.
  
=Quick Wizard =  
+
==Quick Wizard ==  
 
Extra \ Quick Wizard is a good place to start a new test case.
 
Extra \ Quick Wizard is a good place to start a new test case.
 
Only a few things to notice:
 
Only a few things to notice:
Line 35: Line 38:
 
[[File:quickstart-extras.png | center]]
 
[[File:quickstart-extras.png | center]]
  
== Record ==  
+
== Record ==
 
Run your ZK application. Choose the "Setup" node and click "Start test run" (or press enter), QF-test will execute "Setup" node, open a custom browser window and connect to the specified URL.  
 
Run your ZK application. Choose the "Setup" node and click "Start test run" (or press enter), QF-test will execute "Setup" node, open a custom browser window and connect to the specified URL.  
 
[[File:customBrowser.png | center]]
 
[[File:customBrowser.png | center]]
Line 42: Line 45:
  
 
== Check ==
 
== Check ==
After you perform some test actions, you would like to verify some conditions on the page. Click "Record check" button [[File:recordChecks.png]] first and hover your mouse pointer on the ZK component you want to check, and you shall see a blue box highlighted on the ZK component recognized by QF-test.  
+
After you perform some test actions, you would normally like to verify some conditions on the page. Click "Record check" button [[File:recordChecks.png]] first and hover your mouse pointer on the ZK component you want to check, and you shall see a blue box highlighted on the ZK component recognized by QF-test.  
 
<ref>Sometimes it might not highlight the component as you expect, you can turn off "Record check" and turn it on again. If it still doesn't work, it could be a bug of the tool. The alternative is to use "image check". </ref>  
 
<ref>Sometimes it might not highlight the component as you expect, you can turn off "Record check" and turn it on again. If it still doesn't work, it could be a bug of the tool. The alternative is to use "image check". </ref>  
 
Left-click will add a default check, text check. Right click and you can select different checks, like "Image" or "Visible".
 
Left-click will add a default check, text check. Right click and you can select different checks, like "Image" or "Visible".
Line 60: Line 63:
  
 
== Recognized Components ==
 
== Recognized Components ==
After stopping the recording, you will also find that there are nodes created under "Window and Component" node. Those nodes are components identified during recording and will be used by the tool. If you remove a component node which is referenced by a test case, it will cause ComponentNotFoundException.
+
After recording has stopped, you will also find that there are nodes created under "Window and Component" node. Those nodes are components identified during recording and will be used by the tool. If you remove a component node which is referenced by a test case, it will cause ComponentNotFoundException.
  
 
[[File:windowsComponents.png | center ]]
 
[[File:windowsComponents.png | center ]]
  
= Standard Library =  
+
= Simulate User Actions =
 +
Following the steps illustrated above most of the cases would run out of box. However there are some actions that cannot be recorded and replayed directly and need some tweaking. Here under I will share some tips on how you can change a recorded event's property manually and make it work.
 +
 
 +
== Standard Library ==  
 
Every Test-suite includes [http://www.qfs.de/qftest/manual/en/user_stdlib.html a standard library] by default.
 
Every Test-suite includes [http://www.qfs.de/qftest/manual/en/user_stdlib.html a standard library] by default.
 
[[File:includeStandardLibrary.png | center]]
 
[[File:includeStandardLibrary.png | center]]
  
  
It contains lots of procedures for accessing and checking components, file system and database access, logging messages or screenshots, and performs cleanup in a generic way. You can invoke them with "Call procedure" node in a Sequence node to be part of your testing process.
+
It contains lots of procedures for accessing and checking components, file system and database access, logging messages or screenshots and performs cleanup in a generic way. You can invoke them with "Call procedure" node in a Sequence node to be part of your testing process. This library will be used later in this section.  
  
 
For a complete list of the standard library, please refer to http://www.qfs.de/include/qfs_pkgdoc/qfs_pkgdoc.html.
 
For a complete list of the standard library, please refer to http://www.qfs.de/include/qfs_pkgdoc/qfs_pkgdoc.html.
 
= Simulate User Actions =
 
QF-test can record most of the user actions, but some actions cannot be recorded and replayed directly. I have here shared some tips on how you can change a recorded event's properties manually and make them work.
 
 
  
 
==Drag and Drop ==
 
==Drag and Drop ==
Line 88: Line 90:
 
== Hover ==
 
== Hover ==
 
Hovering a mouse pointer is just like moving a mouse, it cannot be recorded directly.  
 
Hovering a mouse pointer is just like moving a mouse, it cannot be recorded directly.  
The steps to workaround are:
+
The workaround steps are:
 
# When recording, click the place you want to hover on.
 
# When recording, click the place you want to hover on.
 
# Change the Mouse Event "Event detail" to  '''MOUSE_DRAG_OVER'''.
 
# Change the Mouse Event "Event detail" to  '''MOUSE_DRAG_OVER'''.
Line 99: Line 101:
  
 
=== Browser's Scrollbar ===
 
=== Browser's Scrollbar ===
Moving a browser's scrollbar is recorded as mouse clicks event and replay them doesn't actually move the browser's scrollbar. We also can achieve this action by using MOUSE_DRAG_FROM and MOUSE_DRAG_TO, just like what we do for "Drag and Drop". But actually you don't need to replay moving a browser's scrollbar in most cases, just replay the actions performed on components. QF-test will scroll to the target component automatically.
+
Moving a browser's scrollbar is recorded as mouse clicks events and replaying them doesn't actually move the browser's scrollbar. We can also achieve this action by using MOUSE_DRAG_FROM and MOUSE_DRAG_TO, just like what we do for "Drag and Drop". But actually you don't need to replay moving a browser's scrollbar in most cases, just replay the actions performed on components. QF-test will scroll to the target component automatically.
  
 
=== Listbox's Scrollbar ===
 
=== Listbox's Scrollbar ===
We can also achieve this action by MOUSE_DRAG_FROM and MOUSE_DRAG_TO, but the position it moves at replaying is not precise. Hence, each replay will move the scrollbar to different positions and fails a test case easily. I suggest to use PageUp and PageDown to scroll the view instead.
+
We can also achieve this action by MOUSE_DRAG_FROM and MOUSE_DRAG_TO, but the position it moves at replaying is not precise. Hence, each replay will move a scrollbar to different positions and fails a test case easily. I suggest using PageUp and PageDown to scroll the view instead.
  
== Upload ==  
+
== Upload ==
 
You have to check <tt>Replay as "hard" event</tt> property in the node of clicking "Browse..." button.
 
You have to check <tt>Replay as "hard" event</tt> property in the node of clicking "Browse..." button.
 
[[File:qftest-upload.png | center]]
 
[[File:qftest-upload.png | center]]
Line 111: Line 113:
 
[[File:callFileUpload.png | center]]
 
[[File:callFileUpload.png | center]]
  
= Other Tips =
+
=Perform a Check =
== Inputting a Datebox ==
 
When recording a Datebox's input, you should input with text instead of selecting a day on the small calendar. Because Datebox will show the current month by default. If you select the small calendar, the month you recorded might not be the same as the month you replay. This will cause an unexpected input and fails your test case.
 
 
 
== Differentiate Multiple Message Boxes ==
 
Multiple message boxes on the same page should have different titles or QF-test cannot differentiate them.
 
  
=Perform a Check =
+
As mentioned in previous sections, after recording a test case you can add a check easily by left or right-click on the target component. Most of the checks run out of box as illustrated in their tutorial but not all. Here are some tips that will hopefully make your life easier:
  
 
== Image Check ==
 
== Image Check ==
  
Image Check is very useful when you cannot perform text check or want to check an overall condition instead of checking one widget by another. But it's very common that a screenshot captured at the run-time has a minor difference from the target screenshot.  QF-test default image comparison algorithm is '''pixel by pixel'''. So any minor difference may fail the image check. Fortunately, we can change comparison algorithm to tolerant image deviation for a "Check image" node by specifying
+
Image Check is very useful when you cannot perform text check or want to check an overall condition instead of checking widgets one by one. However, it's very common that a screenshot captured at the run-time has a minor difference from the target screenshot.  QF-test default image comparison algorithm is '''pixel by pixel''', so any minor difference may fail the image check. Fortunately, we can change comparison algorithm to tolerant image deviation for a "Check image" node by specifying
  
 
<tt> algorithm=identity;expected=0.95</tt>
 
<tt> algorithm=identity;expected=0.95</tt>
Line 138: Line 135:
 
[[File:callCompareFiles.png | center]]
 
[[File:callCompareFiles.png | center]]
  
Note that even if comparison procedure returns false it will not fail a test case automatically. We need to add the following steps to report an error when the procedure returns false:
+
However, comparison procedure returns false will not make a test case fail automatically, we can fail a test case by the procedures below:
 +
 
 
# set "Variable for return value" in "Call procedure" node (the screenshot above), e.g. <tt>filesAreEquals</tt>
 
# set "Variable for return value" in "Call procedure" node (the screenshot above), e.g. <tt>filesAreEquals</tt>
 
# add If node and specify the condition with <tt>not ${filesAreEquals}</tt> (the screenshot below)
 
# add If node and specify the condition with <tt>not ${filesAreEquals}</tt> (the screenshot below)
Line 144: Line 142:
 
[[File:ifNode.png | center]]
 
[[File:ifNode.png | center]]
  
= Download =  
+
= Other Tips =
You can download test cases and the example application and run it by yourselves. You may understand better.
+
== Inputting a Datebox ==
Sample ZK application: http://gitlab.zkoss.org/hawkchen/qfsut
+
When recording a Datebox's input, you should input with text instead of selecting a day from the small calendar. Because Datebox will show the current month by default. If you select from the small calendar, the month you recorded might not be the same as the month you replay. This will cause an unexpected input and fails your test case.
 +
 
 +
== Differentiate Multiple Message Boxes ==
 +
Multiple message boxes on the same page should have different titles or QF-test cannot differentiate them.
 +
 
 +
= Summary and Download =  
 +
In general I found QF-Test is easy to setup and useful for performing most of the GUI test cases against ZK. Thanks to its built-in resolvers that identifies ZK components and handles it automatically without having the testers to code, setup ID and/or locators. Also, their complete tutorial was a good reference.
  
Sample Test Suites: http://gitlab.zkoss.org/hawkchen/qfsut/tree/master/qftest
+
I hope these tips covers most of the tricky parts and saves your time like how the QF-Test Support Team helped me. I have shared my test cases on gitlab. You can download these test cases and the example application and run them up by yourselves which may help you understand how the tool works with ZK better.<br/>
It contains test cases I made for trying QF-test. Readers can use them as a reference:
+
 
 +
Sample ZK application: http://gitlab.zkoss.org/hawkchen/qfsut<br/>
 +
Sample Test Suites: http://gitlab.zkoss.org/hawkchen/qfsut/tree/master/qftest<br/>
 +
It contains test cases I created while trying out QF-test. Feel free to use them as a study reference:
 
[[File:ExampleTestCase.png | center]]
 
[[File:ExampleTestCase.png | center]]
 +
 +
 +
Note that QF-Test is a product of Quality First Software GmbH, please consult Quality First Software in case of any licensing and/or technical support matters.
  
 
= References =
 
= References =
Line 156: Line 166:
 
<references/>
 
<references/>
  
=Comments=
+
 
 
<div style="font-size:20px">
 
<div style="font-size:20px">
 
Welcome any feedback. Is this article useful to you? Do you want to know more topics about it? Leave your comments.
 
Welcome any feedback. Is this article useful to you? Do you want to know more topics about it? Leave your comments.
Line 164: Line 174:
 
|name=Potix Corporation
 
|name=Potix Corporation
 
}}
 
}}
 +
 +
[[Category:Small Talk]]

Revision as of 06:40, 15 September 2017

DocumentationSmall Talks2015MarchTesting ZK-based Application with QF Test
Testing ZK-based Application with QF Test

Author
Hawk Chen, Engineer, Potix Corporation
Date
March 12, 2015
Version
QF-Test 4.0.3
ZK 7

Overview

QF-Test is a GUI testing tool for Java and Web, a previous small talk, Testing ZK Applications at Business Level with QF-Test, already gives us an overview of the tool. As a team member of ZK, I was interested in trying it out myself and understand how it could benefit our users. This is why I started this article.

QF-Test has a complete tutorial and following their tutorial most of the test cases run well. However for some specific user actions manual tweaking is required. In this article, I will focus on sharing these useful tweaking tips especially around recording and replaying. Also, my testing samples are shared in gitlab for your reference. I did not have the chance to try out advanced features such as remote execution and reading test data from data sources like Excel files, you can explore them by yourself if you are interested.

How It Is Different from Other Testing Tools

When it comes to test we need to think about what we want to test. Server-side logic or client side display? Functional test or stress test? The following tools are popular functional testing tools among the ZK community.

ZATS Mimic is a unit test library that is designed to test an application's server-side logic during agile development. It plays a complementary role to a GUI (client-side) test tool like Selenium and QF-test.

Selenium might be most users' first choice to perform a browser test against a ZK application as it's something most people are familiar with. However according to ZK Testing with Selenium IDE, you might need to deal with ID generator and locator by yourself.

Sahi is also a web automation testing tool, it provides special functions in Sahi scripting language to identify ZK widget without ID generator. You can learn more from ZK Testing with Sahi.

QF-Test [1] focuses on creating test cases in a graphical tree, which allows business testers to create and read tests without having much coding knowledge. The special integration for ZK offers an optimized component recognition algorithm, which filters for the most important ZK HTML elements and ZK ids. Due to that special effort for ZK widgets, you can access content of data containers like trees, tables or lists directly by one click without having to take care of the internal HTML structure of those widgets. Nevertheless, it's also possible to use XPATH or CSS selectors to determine objects. Find an online video describing QF-Test's approach for component recognition at https://www.youtube.com/watch?v=VE_mJAZpMx0.

Record and Replay a Test Case

The most intuitive way in QF-Test to create a test case is to record your actions on a browser. QF-Test tutorial describes how you can create a test case in details. For step-by-step setup, please reference their tutorial. Here, I just mention a few key points to give you a basic idea about the record and replay process.

Quick Wizard

Extra \ Quick Wizard is a good place to start a new test case. Only a few things to notice:

Then you will see a "Setup" node appears at "Extras" Node:

Quickstart-extras.png

Record

Run your ZK application. Choose the "Setup" node and click "Start test run" (or press enter), QF-test will execute "Setup" node, open a custom browser window and connect to the specified URL.

CustomBrowser.png

Then you now can click "Start recording" button StartRecord.png and perform the steps to test the application.

Check

After you perform some test actions, you would normally like to verify some conditions on the page. Click "Record check" button RecordChecks.png first and hover your mouse pointer on the ZK component you want to check, and you shall see a blue box highlighted on the ZK component recognized by QF-test. [2] Left-click will add a default check, text check. Right click and you can select different checks, like "Image" or "Visible".

CheckOptions.png

You can visit http://www.qfs.de/qftest/manual/en/checks.html to know more details about all supported checks.

Put Them Together

After clicking "Stop recording" button StopRecord.png, a "Sequence" node with recorded actions will be automatically created at "Extras" node. Finally, add a "clean up" node. To make things clearer, I put these 3 nodes into a "Test case" node like:

Qftest-testcase.png


When creating multiple test cases, you can just copy a test case node and modify without using QuickStart Wizard.

Recognized Components

After recording has stopped, you will also find that there are nodes created under "Window and Component" node. Those nodes are components identified during recording and will be used by the tool. If you remove a component node which is referenced by a test case, it will cause ComponentNotFoundException.

WindowsComponents.png

Simulate User Actions

Following the steps illustrated above most of the cases would run out of box. However there are some actions that cannot be recorded and replayed directly and need some tweaking. Here under I will share some tips on how you can change a recorded event's property manually and make it work.

Standard Library

Every Test-suite includes a standard library by default.

IncludeStandardLibrary.png


It contains lots of procedures for accessing and checking components, file system and database access, logging messages or screenshots and performs cleanup in a generic way. You can invoke them with "Call procedure" node in a Sequence node to be part of your testing process. This library will be used later in this section.

For a complete list of the standard library, please refer to http://www.qfs.de/include/qfs_pkgdoc/qfs_pkgdoc.html.

Drag and Drop

If you just record drag and drop action and replay it, you will find it doesn't work as expected. As a workaround I simulate "drag and drop" with the following steps:

  1. When recording, click on the source item and click on the destination, end record
  2. Change Event details manually. Change source click to MOUSE_DRAG_FROM and destination click to MOUSE_DROP_TO
  3. Adjust X, Y value of drag or drop position in fine grain

Please refer to sample test case Drag and Drop.

Hover

Hovering a mouse pointer is just like moving a mouse, it cannot be recorded directly. The workaround steps are:

  1. When recording, click the place you want to hover on.
  2. Change the Mouse Event "Event detail" to MOUSE_DRAG_OVER.

Please refer to sample test case Hover.

Move Scrollbar

This divides into 2 cases: move a browser's scrollbar and a Listbox's scrollbar (or Grid's).

Browser's Scrollbar

Moving a browser's scrollbar is recorded as mouse clicks events and replaying them doesn't actually move the browser's scrollbar. We can also achieve this action by using MOUSE_DRAG_FROM and MOUSE_DRAG_TO, just like what we do for "Drag and Drop". But actually you don't need to replay moving a browser's scrollbar in most cases, just replay the actions performed on components. QF-test will scroll to the target component automatically.

Listbox's Scrollbar

We can also achieve this action by MOUSE_DRAG_FROM and MOUSE_DRAG_TO, but the position it moves at replaying is not precise. Hence, each replay will move a scrollbar to different positions and fails a test case easily. I suggest using PageUp and PageDown to scroll the view instead.

Upload

You have to check Replay as "hard" event property in the node of clicking "Browse..." button.

Qftest-upload.png

Call the procedure qfs.web.input.fileUpload can also do the same trick.

CallFileUpload.png

Perform a Check

As mentioned in previous sections, after recording a test case you can add a check easily by left or right-click on the target component. Most of the checks run out of box as illustrated in their tutorial but not all. Here are some tips that will hopefully make your life easier:

Image Check

Image Check is very useful when you cannot perform text check or want to check an overall condition instead of checking widgets one by one. However, it's very common that a screenshot captured at the run-time has a minor difference from the target screenshot. QF-test default image comparison algorithm is pixel by pixel, so any minor difference may fail the image check. Fortunately, we can change comparison algorithm to tolerant image deviation for a "Check image" node by specifying

algorithm=identity;expected=0.95

at "Algorithm for image comparison" field.

ComparisonAlgorithm.png


For complete algorithm you can use, please refer to http://www.qfs.de/qftest/manual/en/tech_imagealgorithmdetails.html#sec_imagealgorithmdetails.

Downloaded File Check

There is no check option for downloaded files, you have to call a procedure qfs.utils.files.compareFiles to compare two files by specifying file paths.

CallCompareFiles.png

However, comparison procedure returns false will not make a test case fail automatically, we can fail a test case by the procedures below:

  1. set "Variable for return value" in "Call procedure" node (the screenshot above), e.g. filesAreEquals
  2. add If node and specify the condition with not ${filesAreEquals} (the screenshot below)
  3. add a node to log an error message or throw an exception (the screenshot below)
IfNode.png

Other Tips

Inputting a Datebox

When recording a Datebox's input, you should input with text instead of selecting a day from the small calendar. Because Datebox will show the current month by default. If you select from the small calendar, the month you recorded might not be the same as the month you replay. This will cause an unexpected input and fails your test case.

Differentiate Multiple Message Boxes

Multiple message boxes on the same page should have different titles or QF-test cannot differentiate them.

Summary and Download

In general I found QF-Test is easy to setup and useful for performing most of the GUI test cases against ZK. Thanks to its built-in resolvers that identifies ZK components and handles it automatically without having the testers to code, setup ID and/or locators. Also, their complete tutorial was a good reference.

I hope these tips covers most of the tricky parts and saves your time like how the QF-Test Support Team helped me. I have shared my test cases on gitlab. You can download these test cases and the example application and run them up by yourselves which may help you understand how the tool works with ZK better.

Sample ZK application: http://gitlab.zkoss.org/hawkchen/qfsut
Sample Test Suites: http://gitlab.zkoss.org/hawkchen/qfsut/tree/master/qftest
It contains test cases I created while trying out QF-test. Feel free to use them as a study reference:

ExampleTestCase.png


Note that QF-Test is a product of Quality First Software GmbH, please consult Quality First Software in case of any licensing and/or technical support matters.

References

  1. QF-Test official website: http://www.qfs.de/
  2. Sometimes it might not highlight the component as you expect, you can turn off "Record check" and turn it on again. If it still doesn't work, it could be a bug of the tool. The alternative is to use "image check".


Welcome any feedback. Is this article useful to you? Do you want to know more topics about it? Leave your comments.


Comments



Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.