The document describes TApp, a test automation application. It includes sections about understanding web elements, graphical user interfaces, test cases, test steps, test scenarios, and Bamboo integration. TApp allows creating and running automated tests as an integral part of the software development process.
2. TApp
? About TApp
Creating and Running Tests
? Understanding Web Elements / Objects
? Understanding Graphical User Interface,
Test Cases, Test Steps and Test
Scenarios
? Understanding Configurations
? Running Tests
Bamboo Integration
? Bamboo requirement
3. About TApp
The Test Automation Application (TApp) is a solution to automate
testing as an integral part of the Software Development process.
TApp
4. Web Elements / Objects
CSS Selector
Name
Link Text / Partial Link Text
6. CSS Selectors
Selector Example Example description CSS
#id #firstname Selects the element with id="firstname" 1
* * Selects all elements 2
element p Selects all <p> elements 1
element,element div, p Selects all <div> elements and all <p> elements 1
element element div p Selects all <p> elements inside <div> elements 1
element>element div > p Selects all <p> elements where the parent is a <div> element 2
element+element div + p
Selects all <p> elements that are placed immediately after <div>
elements
2
element1~element2 p ~ ul Selects every <ul> element that are preceded by a <p> element 3
[attribute] [target] Selects all elements with a target attribute 2
7. CSS Selectors
Selector Example Example description CSS
[attribute=value] [target=_blank] Selects all elements with target="_blank" 2
[attribute~=value] [title~=flower]
Selects all elements with a title attribute containing
the word "flower"
2
[attribute|=value] [lang|=en]
Selects all elements with a lang attribute value
starting with "en"
2
[attribute^=value] a[href^="https"]
Selects every <a> element whose href attribute value
begins with "https"
3
[attribute$=value] a[href$=".pdf"]
Selects every <a> element whose href attribute value
ends with ".pdf"
3
[attribute*=value] a[href*="w3schools"]
Selects every <a> element whose href attribute value
contains the substring "w3schools"
3
:active a:active Selects the active link 1
::after p::after
Insert something after the content of each <p>
element
2
::before p::before
Insert something before the content of each <p>
element
2
8. CSS Selectors
Selector Example Example description CSS
:disabled input:disabled Selects every disabled <input> element 3
:empty p:empty
Selects every <p> element that has no children
(including text nodes)
3
:enabled input:enabled Selects every enabled <input> element 3
:first-child p:first-child
Selects every <p> element that is the first child of its
parent
2
::first-letter p::first-letter Selects the first letter of every <p> element 1
::first-line p::first-line Selects the first line of every <p> element 1
:first-of-type p:first-of-type
Selects every <p> element that is the first <p>
element of its parent
3
:focus input:focus Selects the input element which has focus 2
:hover a:hover Selects links on mouse over 1
9. CSS Selectors
Selector Example Example description CSS
:invalid input:invalid Selects all input elements with an invalid value 3
:lang(language) p:lang(it)
Selects every <p> element with a lang attribute equal to
"it" (Italian)
2
:last-child p:last-child
Selects every <p> element that is the last child of its
parent
3
:last-of-type p:last-of-type
Selects every <p> element that is the last <p> element
of its parent
3
:link a:link Selects all unvisited links 1
:not(selector) :not(p) Selects every element that is not a <p> element 3
:nth-child(n) p:nth-child(2)
Selects every <p> element that is the second child of its
parent
3
:nth-last-child(n) p:nth-last-child(2)
Selects every <p> element that is the second child of its
parent, counting from the last child
3
:nth-last-of-type(n) p:nth-last-of-type(2)
Selects every <p> element that is the second <p>
element of its parent, counting from the last child
3
10. CSS Selectors
Selector Example Example description CSS
:only-of-type p:only-of-type
Selects every <p> element that is the only <p>
element of its parent
3
:only-child p:only-child
Selects every <p> element that is the only child
of its parent
3
:optional input:optional
Selects input elements with no "required"
attribute
3
:out-of-range input:out-of-range
Selects input elements with a value outside a
specified range
3
:read-only input:read-only
Selects input elements with the "readonly"
attribute specified
3
:read-write input:read-write
Selects input elements with the "readonly"
attribute NOT specified
3
:required input:required
Selects input elements with the "required"
attribute specified
3
:root :root Selects the document's root element 3
::selection ::selection
Selects the portion of an element that is selected
by a user
11. CSS Selectors
Selector Example Example description CSS
:target #news:target
Selects the current active #news element (clicked on a URL
containing that anchor name)
3
:valid input:valid Selects all input elements with a valid value 3
:visited a:visited Selects all visited links 1
12. XPath Locators
Expression Description
nodename Selects all nodes with the name "nodename"
/ Selects from the root node
//
Selects nodes in the document from the current node that match the selection
no matter where they are
. Selects the current node
.. Selects the parent of the current node
@ Selects attributes
XPath uses path expressions to select nodes or node-sets in an XML document. The node is
selected by following a path or steps.
13. XPath Locators
Path
Expression
Result
bookstore Selects all nodes with the name "bookstore"
/bookstore
Selects the root element bookstoreNote: If the path starts with a slash ( / ) it
always represents an absolute path to an element!
bookstore/
book
Selects all book elements that are children of bookstore
//book Selects all book elements no matter where they are in the document
bookstore/
/book
Selects all book elements that are descendant of the bookstore element, no
matter where they are under the bookstore element
//@lang Selects all attributes that are named lang
Path expressions and the result of the expressions:
14. XPath Locators
Path Expression Result
/bookstore/book[1]
Selects the first book element that is the child of the bookstore element. Note: In IE 5,6,7,8,9 first node
is[0], but according to W3C, it is [1]. To solve this problem in IE, set the SelectionLanguage to XPath:
In JavaScript: xml.setProperty("SelectionLanguage","XPath");
/bookstore/book[last()] Selects the last book element that is the child of the bookstore element
/bookstore/book[last()-1] Selects the last but one book element that is the child of the bookstore element
/bookstore/book[position()<3] Selects the first two book elements that are children of the bookstore element
//title[@lang] Selects all the title elements that have an attribute named lang
//title[@lang='en'] Selects all the title elements that have a "lang" attribute with a value of "en"
/bookstore/book[price>35.00]
Selects all the book elements of the bookstore element that have a price element with a value greater
than 35.00
/bookstore/book[price>35.00]/title
Selects all the title elements of the book elements of the bookstore element that have a price element
with a value greater than 35.00
Predicates
Predicates are used to find a specific node or a node that contains a specific value.
Predicates are always embedded in square brackets.
In the table below we have listed some path expressions with predicates and the result of the expressions:
15. XPath Locators
Wildcard Description
* Matches any element node
@* Matches any attribute node
node() Matches any node of any kind
Selecting Unknown Nodes
XPath wildcards can be used to select unknown XML nodes.
Path
Expression
Result
/bookstore
/*
Selects all the child element nodes of the bookstore element
//* Selects all elements in the document
//title[@*] Selects all title elements which have at least one attribute of any kind
16. XPath Locators
Selecting Several Paths
By using the | operator in an XPath expression you can select several paths.
Path Expression Result
//book/title | //book/price Selects all the title AND price elements of all book elements
//title | //price Selects all the title AND price elements in the document
/bookstore/book/title | //price
Selects all the title elements of the book element of the
bookstore element AND all the price elements in the
document
17. Graphical User Interface
Main Configuration Window
List of Test Suites per project
List Test Cases within the Test Suite
Test Steps of the selected Test CaseOther available Test Cases
Option to Select All Test Cases
Option whether the Test Case will be ran during testing
Name of the selected Test Suite
Platform of the Suite and other options
Site to be tested
Root URL of the site
Headless execution
Failed step will terminate the testing
Recipient of the report
History of runs
18. Graphical User Interface
File Menu
TApp version
Create New Suite
Save Suite
Logout (will show again the Login Form)
Terminates TApp
23. Graphical User Interface
Test Script Generator
List of Test Script per project
Name of the Selected Test Script
Platform of the Test Script
Action to be done to Object
Object to find within the app/page
Sub-action to be done to
object with data referencing
Data to supply or select to
Conditions for validating
logical data from the object
Data to be validated
against the data
from the object
Add/Update test step to table
List of steps to be performed from the selected Test Script
27. Graphical User Interface
Run Console
Name of the Test Suite and what browser it is executed
Pause the test execution
Test results
Path of the generated report
Test step details
Opens the .doc file of the test report
28. Test Cases
Creating Test Cases
Click Add/Edit Test Scripts in the Test Script menu
Click yes to create a new test caseSelect a platform
38. Test Steps
Passing an Object¡¯s Value To A Variable
Syntax
From <object> <store value to map>
To use the stored value, use
**map** <variable name>
Ex. **map** variableMap1
39. Test Steps
Passing the System¡¯s Date and Time
Syntax
**datetime** <longdate / shortdate /
custom_format>
longdate : September 14, 2016
shortdate : 09/14/16
Custom Format should follow the SimpleDateFormat item formats
41. Test Steps
Validating an Object¡¯s Value
Syntax
Validate <object> if <validation operator>
<validation data>
42. Test Steps
Validating CSV, TAB and EXCEL Files
Syntax
Validate **file** <filename> if **colrow**
<column,row> <validation operator>
<validation data>
**file** - function that tells TApp that the supplied object is a physical file
**colrow** - function that parses the supplied parameter as column and row
To check the whole content of the file, just empty the Option Parameter field.
43. Test Steps
Validating XML File
Syntax
Validate **file** <filename> if **tag**
<tag/node> <validation operator>
<validation data>
**file** - function that tells TApp that the supplied object is a physical file
**tag** - function that parses the supplied parameter as XML tag/node/element
To check the whole content of the file, just empty the Option Parameter field.
44. Test Steps
Validating PDF File
Syntax
Validate **file** <filename> if **page**
<page number> <validation operator>
<validation data>
**file** - function that tells TApp that the supplied object is a physical file
To search on a specific page, use: **page**
Example: **page** <page number>
To search in specific page range, use: **pages**
Example: **pages** <starting page>-<ending page>
To check the whole content of the file, just empty the Option Parameter field.
47. Test Steps
Navigating to a Web Address
Syntax
Switch To WebView with URL <URL>
Using Well-formed URL
Using Base URL from Configuration
Base URL is http://anz-go-dev.aws.cambridge.edu.au/
67. Test Steps
Validating CSS Properties
Syntax
Validate CSS of <object> if <css property>
(String) equals <validation data>
Note: CSS shorthand property is not recognized.
e.g. margin 10px 5px 15px 20px
Should be <css property> <validation data>:
margin-top 10px
margin-right 5px
margin-bottom 15px
margin-left 20px
68. Test Scenarios
Creating a Test Scenario
1. Click the Project where the Test Scenario will be created
2. Go to File and click New to create a Test Scenario
69. Test Scenarios
Creating a Test Scenario
A new Test Scenario will be created¡
with a blank Test Configuration to fill-up
70. Test Scenarios
Adding Test Cases
After completing the Test Configuration
Double-click a Test Case to add it into the
Test Scenario or¡
73. Test Configuration
Web
Name of the selected Test Suite
Browsers where the Test Suite will be executed
Site to be tested
Root URL of the site
Headless execution Failed step will
terminate the testing
Recipient of the report
74. Test Configuration
Mobile - Android
Name of the selected Test Suite
Browsers where the Test Suite will be executed
Option to use Actual device or emulator
Unique ID of the actual device
Headless execution Failed step will
terminate the testing
Recipient of the report
Emulator properties
Android app location
Package name of app
75. Test Configuration
Mobile - iOS
Name of the selected Test Suite
Option to use Actual device or simulator
Unique ID of the actual device
Headless execution Failed step will
terminate the testing
Recipient of the report
iOS app location
Actual device/emulator properties
76. Running Tests
Executing Automated Tests
Find the Test Scenario that you want to run
Click the ¡°Run Test¡± button or press F5 on your keyboard
77. Running Tests
Run Console and Browser
The Run Console and the
browser specified will appear
After the test is done, you can open
the view the report by clicking
¡°Open Generated Report¡±
80. Bamboo Integration
Run Tests on Remote Machine
Command line syntax:
Tappconsole [switch] [arguments]
Arguments:
-s or --suite (e.g. tapp_demo) *this is a required argument
-b or --browser (e.g. firefox, chrome)
-u or --url (e.g. http://www.google.com)
-h or --headlessexecution (e.g. true or false)
-r or --runinremoteserver (e.g. true or false)
-c or --consolerun (e.g. true or false)
-udid or --usedeviceid (e.g. LGD855ba0fc069)
Sample Call:
Tappconsole -s ¡°tapp_demo¡±
**Enclose arguments in double-quotes if a space is present in the test suite name