Wednesday, March 12, 2014

Summary3 (Selenium, HP Quality Center, XPath, SOAPUI)

Selenium IDE


What is test automation?


Two types of test automation:
- Code driven testing: Selenium IDE
- GUI testing: Selenium IDE allow user to execute same type of condition. Selenium mimics action of
black box tester

Advantages of Automation:


Reason for automation: (ERA)
- Efficiency
- Reusable
- Accurate

What is selenium?

Selenium Background:


Selenium components:
- IDE: run and executed using RC
- RC: allows more robust functionality of automated tool.
- Grid: configuration
- Core: works with RC. Allows information to easily understand.

Selenium IDE:

- SIDE features:


Test case #1: Login

- Test case objective: Ensure valid user login

Expected results:
1) OrangeHRM index page is loaded
2) Correct username is displayed as part of greeting
"Welcome admin"
Steps:
1. In the login test box, type "admin".
2. In the password textbox type "password".
3. Click Submit button
4. Verify that correct user name is displayed
5. Logout
Click to record red button
Welcome admin---right click---verify text present: welcome admin
Table shows what was recorded in form of table

- Command: What you want to do?
- Target: Where you want to do?
- Values: Additional information or inputs
- recorded and played back
- Dark green completion of verification of expected with actual results.
- Log is written

What happened during execution?

Debugging: What went wrong?

Test suite : combination of one or more test cases

RC:

Selenium RC Components:

- Selenium Server: which launches and kills browsers
- Client libraries: which provide interface between each programming language and selenium RC server.

Selenium Server:

Client libraries

Selenium IDE generated code looks like this:

Selenium server logging
- Server side logs:
- Browser side logs:

Handling HTTPS and Security Popups:

Troubleshooting common problems
1) Unable to connect to server:
2) Unable to load browser
3) Selenium cannot find the AUT
4) Firefox refused to shutdown while preparing profile
5) Versioning problems
6) Error message: "(Unsupported major.minor version 49.0)" while starting server
7) 404 error when running the getNewBrowserSession command
8) Permission denied Error
9) Error encountered -"Cannot convert object to primitive value" with shutdown of googlechrome browser

Mobile application automation testing
1)            Decision to Automate Test
2)            Test Tool Acquisition
3)            Automated testing Introduction Process
4)            Test Planning, Design and Development
5)            Execution and management of tests
6)            Test Program Review and Assessment
Mobile testing automation services consists of:
-              Functional Testing Automation(Best Approach):
-              Functional testing automation is combination of unit testing type scripts with support for instrumentation on emulator or real devices.
-              Android SDK provides instrumentation support for JUnit like test scripts that can be executed on Android SDK emulator on test engineers desktop system or build integration system in continuous integration environment.

UI Testing automation: Achieved by using various Automation tools like Robotium, and Perfect Mobiles and DeviceAnywhere.

Unit testing Automation:
 Unit testing automation is based on popular xUnix family of tools like Jmunit for Android platforms, and Ocunit for iOS unit testing code.

Tools used:
 Robotium
FoneMonkey:
Perfecto:
DeviceAnywhere:
 Use of test automation
-              Use of emulators and actual devices
-              Testing for mobile environment and application complexity

Web Driver
Selenium 1.0 + Webdriver = Selenium 2.0
The implementation classes one should use are listed as below:
- Androiddriver
- Chromedriver
- Firefoxdriver
- Htmlunitdriver
- InternetexplorerDriver
- IPhoneDriver
- PhantomJSDriver
- RemoteWebDriver
- SafariDriver



SDL Tridion


Web content management system

Tridion rendering tree:


- XML schema
- Component
- Component template
- Component presentation
- Page template
- Page

Rendering is done by Component template.

What is difference between pages and component presentation?

Page Template SDL tridion:

SDL tridion publications:

Tridion Folders:

Structure group:

Tridion CMS concepts:

Schema:
- Define structure of content and determine the type of content that authors can create.
- managed in folders.
- defines input fields for content and metadata
- Schema called "Press Release" could define the following fields:
Headline
Date
Summary
Body
Components based on this schema share the structure defined by schema.

Components:

Component Template:

Component Presentations:

Page template:


Publications, folders, structure groups and categories:

Publications:

Folders:

Structure Groups:

Categories:

Primary roles will be:
User interfaces:

Content Manager Explorer is main
Tridion interface and will be focus of this document.

Content manager explorer is:
- primary tridion interface
- tree structured(similar to windows explorer)
and
- browser based.
Main areas of Content Manager Explorer:
1) Location bar:

2) Left Pane:

Comprised of 6 areas:
- content management
- email management
- website management
- search view
- system administration
- my tasks


3) Content management:
- enables you to navigate and select
- publications in which you will find:
tridion building blocks(in yellow) such as components and
tridion structure group(in purple) and
- publishing queue

3.1) Publications
- Tridion implementation currently has three publications:
OET Base
OET Common
OET Public Website
- OET Public website publication is  based on OET common publication and future publication may be based on OET common publication as well.

3.2) Folders:
- organize publications building blocks.
- Most publications use standard set of folders: Components, Schemas and Templates.

3.3) Structure groups:
 Logically organize publications websites page.
-Editors or Approvers create structure groups, and as of this documents publications, only one structure group, root has been created.
- We can have many structure groups within the publication.
- We have structure group for each logical area of the website.
- Under root structure group, you could have one structure group for products and services and another for policies and standards.

3.4) Publishing queue:
- last item in the left pane.
- publishing is moving pages and content to the server.

4) Search:
- click search view button in left pane
- enables to search for specific items by entering search parameters on general or advanced level.

5) My tasks:
- all items under My Tasks pertain to  workflow.

6) Toolbar:
- appears directly above working area, contains many icons that change depending upon:
- security settings
- item selected in left pane and
- item displayed in working area.


7) Working area:
- contains items found in selected folder or structure group.

8) Right click menu:

9) Other content manager explorer functions:
- Provides content versioning, ability to checkout and checkin items and  blueprinting

Content versioning:
Checkout and checkin:

10) Where you will be working in Content Manager explorer:
SiteEdit:
Workflows:
Workflow and OET personnel.
OET Tridion Delivery Servers:

How to view your assigned tasks and work on an item:

How to create a component?

- Component types used in pages:
Left navigation
Rich text
Plain text
Related Links


Component types used in OET site templates:
- Header
- Header Navigation
- CSS
- JS
- Footer

How to edit component:

How to create "Content without Left Nav" page

How to create content with left nav page

How to create Two column content with Left Nav page?

How to edit page?

How to retreive version of component or page?

How to perform search?

How to assign workflow to components?

How to assign workflow to pages?

How to approve a page?

How to publish page to server?


HP ALM QC(Quality Center)


HP Quality Center:
Components:
- server
- client
- database

Why is ALM/QC used?

With ALM we can:

Application Lifecycle Management(ALM) flow:

How to start ALM:
Release and Cycle:

Steps to create a new release/cycle in ALM:

Steps to create requirements:

Link requirement to cycle and release:

Creating and managing test cases:

Test case#:1
Test case description: Login with correct credentials
Test data:
1. url: www.gmail.com
2. username: test
3. password: ALM test
Steps to perform:
launch URL
enter username
enter password
click signin button
Expected result:
gmail.com page should open up
username is entered in username field
password entered into password field
and characters are hidden as dots
user is logged in to the gmail.com and inbox is displayed

Test plan tab in ALM:

Linking test cases to requirements:

Steps to create test suite in quality center:

Executing test cases using ALM/QC

Defect management:

How to add defect to ALM

Link defect to test case:

Quality Control Dashboard:

- QC dashboard has following 2 components:
Analysis view
2 tabs:
Analysis view:
graph wizard(choose graph type,choose entity, choose project, choose filter, select graph attributes and click finish

Analysis menu:
- has inbuilt reports based on each side bar menu item.
- Choose report you would like to view.
- I chose Tests with Linked Defects. In right side, you can see its details.
Dashboard view

XPATH

Xpath checker:

What is XPath?

XPath Path Expressions:

XPath Standard functions:

XPath used in XSLT:


XPath Terminology:

Nodes:
- There are seven kinds of nodes:
element
attribute
text
namespace
processing-instruction
comment
document nodes

Atomic values:

Relationship of nodes:
Parent:
Children:
Siblings:
Ancestors:
Descendants:
XPath syntax:
Selecting Nodes:

- The most useful path expressions:
nodename: selects all nodes with name "nodename"
/bookstore: selects from root element bookstore
bookstore/book: selects all book elements that are children of bookstore
//book: selects all book elements no matter where they are in document
bookstore//book: selects all book elements that are descendent of the bookstore element, no matter
where they are under the bookstore element
//lang: selects all attributes that are named lang.
. :  select the current node
.. : selects parent of current node
@ : selects attributes
Predicates:

/bookstore/book[1]: select first book element that is child of bookstore element
/bookstore/book[last()]: select last book element that is child of bookstore element
/bookstore/book[last()-1]: select last but one book element that is child of bookstore element.
/bookstore/book[position()<3]: select first two book element that are children of bookstore element
//title[@lang]: selects all title elements that have attribute named lang
//title[@lang='eng']:select all title elements that have an attribute named lang with value of eng

/bookstore/book[price>35.00]: select all book elements that have price element with value greater than 35.00

Selecting unknown nodes:


Selecting several paths:
//book/title|//book/price: selects all the title AND price elements of all book elements
//title|//price: selects all title AND price elements in the document
/bookstore/book/title|//price: selects all title elements of book element of bookstore element AND all
price elements in the document

XPath Axes:

ancestor: selects all ancestors(parent, grandparent etc) of current node
ancestor-or-self: selects all ancestors of current node and current node itself
attribute: selects all attributes of current node
child: selects all children of current node
descendant: selects all descendants of current node
descendant-or-self: selects all descendant of current node and current node itself
following: selects everything in document after closing tag or current node
following-sibling: selects all siblings after current node
namespace: selects all namespace nodes of current node
parent: selects parent of current node
preceding: selects all nodes that appear before current node in document except ancestors, attribute nodes and namespace node
preceding-sibling: selects all sibling before current node
self: select current node

Location path expression:

absolute location path:
/step/step/...
relative path location:
step/step/...


XPath operators:

|: computes two node sets
+:addition
-:subtraction
*:multiplication
div: division
=:equal
!=: not equal
<:less than
<= less than or equal to
>: greater than
>=: greater than or equal to
or: or
and: and
mod: modulus(division remainder)

XPath examples:
Selecting nodes:
Selecting all the titles:

XPath summary:

- How to find information in an XML document
- how to navigate through elements and attributes in XML document
- use some of standard functions that are built in XPath


SOAP UI


SoapUI

- Mainly used for functional testing
- Main concepts in SOAPUI testing:

Web service mocking
Web service inspection
Functional tests of web services
Web service load tests

Web service mocking is very useful in projects where implementation of the web service has not started or is not finished.
Functional tests of Web services
Webservice inspection
Good support for web service inspection can be very important early in your testing process when you want to find out how web service works.
 Structure of the SoapUI project is like this:
- Project
- Interface
- TestSuites
  TestCases
  TestSteps
  LoadTests
-MockServices

Let us examine a functional test in a testCase.
1. Expand Sample Simple TestSuite and double click on Simple Login and Logout w.Properties steps.
2. Test case consists of five test steps.
3. You can also click Description tab in order to see
in test documentation.
4. Step consists of three different types of testSteps:
- one PropertyStep
- two TestRequests
- two PropertyTransfer Steps

Web Service load tests:

An error in our MockService
- finally we get one error we put in MockService on purpose.

1) Go to TestSuite Sample TestSuite fails if we dont get faults
and the TestCase TestCase: Searching after Logging out LoadTests.
There you will find load test called LoadTest with Multiple Tests will fail.
2) Open it and run it. After a time this test will fail.

As multiple users are simultaneously logging in with same username, which is not allowed by the MockService.