Saturday, April 10, 2021

Automation Anywhere - Recorder

 Automation Anywhere - Recorders

Automation Anywhere supports following recorders.

  1. smart recorder
  2. screen recorder
  3. web recorder
1. smart recorder

  • features smart technology for desktop applications and web sites
  • when you want to record a series of actions on your computer that require capturing objects from application that use HTML, java, WPF, Flex or silverlight, you can use smart recorder with IE9 and above
  • works on objects, co-ordinates, image playback mode
  • adjustable object identification criteria
  • captures window objects and controls such as text from dropdown menus, list box, buttons etc

2. Screen recorder

  • require the same operating system and screen resolution
  • limited to static screens and simple desktop and web applications
  • screen recorders is used to record task or series of actions on the computer when running and automated process on the same computer on which it was recorded, building simple tasks for processes that involves mouse click and keyboard operations 
  • to stop recording shortcut -Ctrl+Alt+S
3. Web recorder
  • it enables automation of internet related task actions
  • features smart technology and suitable for websites
  • record actions based on provided urls, extract single data, pattern based data and tables
  • navigates web controls and works as browser based tool with supports IE 100%
  • sample use case example- open webpage, log into website, navigate to search , enter data into forms and submit them, extract data and updating database records, using web based ERP system , extracting web data to local file, testing an online application
Workbench
  • workbench is use to create Task bot or Meta bot 
  • powerful facility with 582 command library located in left pane
  • drag and drop commands or double click to insert it into any task
  • workbench command executed line by line

Automation Anywhere - Bots

 Automation Anywhere Bots

Automation Anywhere support following type of Bots.

1. Task Bot : Task bots are used to execute task, execute the repetitive rule base process that relay on structure of data. those are easy to build and maintain, operate on presentation layer with any desktop app, execute multiple processes with no errors.

Task bot use- web recorder, object recorder and task editor with support of 582 commands, it runs in background.

2. IQ Bot : IQ bots are next generation inteligent part with cognitive capability, which learn and grows smarter having vision skill

3. Meta Bot : Meta Bots are scalable, extensible, compliance, resilience, maintainabile and offline automation. Those are available in AA enterprise, leverage with task bot, vbscript and macros. it has capable of visual capture, application APIs, navigational flows. Meta Bot offers high ROI, scale automation effectively, company wide automation.

Meta Bot designer - add dlls, record the GUI, upload metabot to control room to repository, allow to wrok multiple metabot at same time and assets display as dlls. all the logics are independent unit.

  • AA enterprise have integrated version control
  • Client -download and check in-out version history and rollback the previous version in needed
  • Credential vault - allow to enterprise level security standard and credential management
  • key feature - centralized secure vault enterprise grade AES256 can be access by authentic user only KMIP
Ways to create bot : 2 ways - recording and task editor

Steps to create bot:
  1.  create a new task using task editor
  2. open application using open program/ file command
  3. use window actions command to maximize application
  4. start recording using smart recorder
  5. fill up the form in application and stop the recording once done
  6. use open spreadsheet command to open excel file that contain data need to be filled in to application
  7. get cell command to read all data from excel sheet
  8. use add variable option to create variable to store data that we read from excel
  9. use loop command along with each row in excel and extract specific command and assign them to chosen variable
  10. edit object cloning command we created earlier and use text to set parameter to set the value
  11. close spreadsheet and save the task
Reference: Automation Anywhere learnings.

Automation Anywhere Enterprise

 Automation Anywhere Enterprise

Automation Anywhere enterprise loaded with feature to automate most of the business process with smart automation technology.

It has 3 recorders, along with 575 drag or drop commands with centralized control.

  • object based smart recorder
  • screen recorder
  • dedicated recorder
It allows to define automation in below way
  1. Automate - any automate process
  2. Manage- centralized control, distribution and analysis
  3. Define - visually document any process with click of button

Automation Anywhere architect having hub with following 3 component

  1. control layer - centralized management
  2. bot creators - create, edit and execute bot as part of dev process. Bot creator is licensed for each type of bot and includes runtime, system for execution and testing. 
  3. bot runners- execute bots - control room controls or schedule and assign bot to the runtime client for the execution. Bot runner can only execute once register, identify and authenticated by control room. authenticated then run independent and asynchronously. All bot telemetry is cached locally and transmitted to control room
Bot creator and Bot runners are authorized control and managed by control room.

unique feature of Automation anywhere:
  1. auto calibration technology
  2. sense of AI Technology
  3. cognitive capability and analystics
  4. unique NLP, platform incorporate ML technique
  5. embeded analystics and system logs
  6. web based control room to queue, launch, manage, orchestrate and maintain any dashboard
  7. versioning system ensure control of automation
  8. centrally controlled license algorithm
  9. private key/public key infrastructure to secure your BOT
  10. stealth mode and keyboard disable, SSAML2.0 protocol
  11. AES and FIPS

Robotic Automation Process

 Robotic Process Automation

RPA records the actions that human does to complete by the computers and replicate all the action as many times as needed with error free.

Benefit of RPA:

  • Trend of automation process with faster implementation
  • employees can focus on creativity, judgement and personal interaction
  • decreased cycle times and improve throughput
  • flexibility and scalability
  • improve accuracy
  • detailed data captured
Factors to identify processes suitable to RPA
  • Rule based processes
  • Digital trigger initiated process supported by the digital data
  • functioning and stable processes
  • high volume processes
Automation Anywhere is one of the powerful RPA tool, which delivers intelligent automation technology, support digital workforce, speed and scale for UI, APIs, OS, Database etc.

Automation Anywhere is infrastructure agnostic- support public or private cloud.

Monday, March 29, 2021

POSTMAN-NewMan CLI API Automation

 INTRODUCTION

This article outlines automation of APIs using postman and new line command line interface as well as batch setup. The paper proposes a way to create collections in postman, use those collection in new man for automation testing and reporting the automation results in different formats.

Overview

Scope of testing will be API testing for this whitepaper. Postman-Newman CLI provides a command line interface for API automation to run quick API automation test

Use of Postman

• Testing rest services using POSTMAN

·         Workspace: stores all collections

·         Collections: collections of requests

·         Test suits : contains tests or test cases

• HTTP request Methods

·         Create a record- POST

·         Retrieve/verify data – GET

·         Update data – PUT

·         Delete data – DELETE

• URL : domain + URI (also call as endpoints)

API Architecture

API calls Collection include mainly three things:

• HTTP headers

• HTTP Request (POST, GET, PUT, DELETE )

• Status Code/ Response Code

·         Date

·         Version

·         Description

·         Author

Newman

Newman is a command line Collection Runner for Postman. It allows you to run and test a Postman Collection directly from the command line. It is built with extensibility in mind so that you can easily integrate it with your continuous integration servers and build systems.

Newman maintains feature parity with Postman and allows you to run collections the way they are executed inside the collection runner in Postman.

Newman resides in the NPM registry and on GitHub.

Pre-requisites

Installation can be done in two ways o Install as google plug in

·         Download as application

o   Download and install node js using below link Link: https://nodejs.org/en/download/

o   Install newman cli globally: npm install -g newman

o To check the version of npm : Npm -v

o To check the version of newman : Newman -v

To get HTML reports in postman ,downloa using the cmd : install -g newman-reporter-htmlextra

Usage

After installing, you can create request collections in postman and run the collection through postman

To share the collections through postman with other test members use below Share collection option.

 To export the collection use the Export button. Once you export the collection, use this collection to run through newman

 API Automation Framework in Postman-Newman CLI

API automation framework can we implement using following way.

A.      Define phase

·         In define phase- we need to create different test collection based on the test

·         requirement and set of data and environments

B.      Execute Phase

·         Once the collections are defined we need to export them and get check in the repositories using github or bitbucket

·         Write the batch job using command line interface for Newman commands to run the collection and generate the report formats

C.      Automate phase

·         In Jenkin, we need to create new item with freestyle project

·         Add build step with “Execute Shell” shell command

·         Assign the newman command or batch job in Jenkin project to get the continuous

·         integration

·         Click save

Run from command line with environment specific collection

Basic setup

--folder [folderName] Specify a single folder to run from a collection.

-e, --environment [file|URL] Specify a Postman environment as a JSON [file] -d, --iteration-data [file] Specify a data file to use either json or csv

-g, --globals [file] Specify a Postman global file as JSON [file]

-n, --iteration-count [number] Define the number of iterations to run

Request options

--delay-request [number] Specify a delay (in ms) between requests [number] --timeout-request [number] Specify a request timeout (in ms) for a request

Misc.

--bail Stops the runner when a test case fails

--silent Disable terminal output

--color off Disable colored output (auto

-k, --insecure Disable strict ssl

-x, --suppress-exit-code Continue running tests even after a failure, but exit with code=0 --ignore-redirectsDisable automatic following of 3XX responses

--verbose Show detailed information of collection run and each request sent

Use the -n option to set the number of iterations to run the collection. Steps to run the collection

o Go to command line with folder in which you kept the postman collection To run the test collection through Newman command line

  You can run collection on specific environment with below command newman run [collection_filename.son] -e [environment_filename. json]

Path of newman in system : C:\Users\[User Name]\newman

Save Results

Results can be saved as JSON data, HTML report, excel report, command line report, junit report and multiple format together as well. By passing a filepath to command you indicate where the file should be generated. If no filename is passed, a default will be used.

c:\Users\[user dir]\Desktop\Postman Files>newman run "example collection1.postman_collection.json" - d data.csv -r htmlextra

 -e is the flag for Environment. This should run through your entire Collection of end.

html report

Newman run “collection name.json” -e “environment.json” -r htmlextra

Junit report

Newman run “collection name.json” -e “environment.json” -r junit

excel report

Newman run “collection name.json” -e “environment.json” -r csv

Command line report

Newman run “collection name.json” -e “environment.json” -r cli

json report

Newman run “collection name.json” -e “environment.json” -r json

Multiple format report

Newman run “collection name.json” -e “environment.json” -r csv,htmlextra,junit

To export report to any location

Newman run “collection name.json” -e “environment.json” -r json -export “newpath” Result:

BDD Cucumber -resequencing the feature file and scenarios

 Hey Folks,

There may be a situation while you need to call your scenario outline of one feature needs to call in particular sequence based on application flow, this can be achieved by adding the tags to scenario outline with priority will work.

However, what happens when you need to sequence your scenario outline with different feature files? 

By default, BDD cucumber takes feature names alphabetically during the execution and then based on your tag sequences. So, if you want to resequencing your scenario in different features file, then you need to give your feature names in sequence of alphabet or append some numbering. if it still doesn't work then rename the feature file name itself and it will work. for example,

Feature file name : 01Feature1.feature, 02Feature2.feature

Feature Name: 01Feature1, 02 Feature2

Cheers,

TJ


API Testing -with POSTMAN

 Web services supported by POSTMAN:

Type of webservices

·         SOAP

·         REST

Installation of POSTMAN

·         Install as google plug in

·         Download as application

Use below URL for sample test rest API requests : https://reqres.in/

Tips:

·         JSON beautifier is used to check the data format

·         Testing rest services using POSTMAN

POSTMAN IDE:

·         Workspace: stores all collections

·         Collections: collections of requests

·         Test suits : contains tests or test cases

HTTP request Methods

·         Create a record- POST

·         Retrieve/verify data – GET

·         Update data – PUT

·         Delete data – DELETE

URL : domain + URI (also call as endpoints)

 Steps to write test cases

·         Get the request run and manually work

·         Understand/parse the request body

·         Write test

Working with get requests steps:

·         Take sample Get request with parameters

·         Go to tests section

·         Use the existing snippet as beginner

·         Write modern code use ES6 javascript code

·         Status code, json body value check

Working with post request steps

·         Let date=date.now() console.log(date)

·         Under pre-req set the prereq actions or steps

·         Set global variables (pm.globals.set(“currentdate”,date)

·         To use environment variable use double curly brackets in request body ex. “currentdate”:{{currentDate}}

 API Architecture

API calls Collection include mainly three things:

1.            HTTP headers

2.            HTTP Request  (POST,GET,PUT,DELETE )

3.            Status Code/ Response Code

Apart from this your application collection include many things if it required to test in you application.

1.       HTTP headers  - HTTP headers are always depended on your application, Mainly two:

·         Authorization - A token included with requests to identify the requester. This header has to be included in all requests other than the login request.

·         Content-Type - A standard MIME type describes the format of object data.Content –type in most of the requests and responses will be application/json.

 2.       HTTP Request  -  There are mainly four request, which we used frequently: DATA =

·         POST - Create Or Update data

·         PUT - Update data

·         GET - Retrieve data

·         DELETE – Delete data

3.       Status Code/Response Code - There are many status/response code, from them we can verify the response.

1.            200 - OK, The request was successful.

2.            201 - Created, The request was successful and data was created.

3.            204 - No Content, The response is empty.

4.            400 - Bad Request, The request could not be understood or was missing required parameters.

5.            401 – Unauthorized, Authentication failed or user does not have permissions for the requested operation.

6.            403 - Forbidden, Access denied.

7.            404 - Not Found, Data was not found.

8.            405 - Method Not Allowed, Requested method is not supported for the specified resource.

9.            500 - Internal Server Error.

10.        503 - Service Unavailable, The service is temporary unavailable.

Postman tips

·         Postman console for debugging- if any error occurred during test snippets, you can verify it using postman console window

·         Postman code generator- below save button, there is link as Code

·         To generate delay between requests- on request > Test tab – set Timeout(()=>{},10000) (10000 means 10 sec)

·         To skip the test in postman request- Go to Test and lets say you have 5 validation out of which need to skip one, you need to write pm.test.skip(“Testname”,function(){pm.expect(response.origin).to.eql(100);});

·         Conditional skip – const islocal=pm.environment.get(‘environment’)==’local’; (islocal?pm.test.skip: pm.test(“Testname”,function(){pm.expect(response.origin).to.eql(100);});

Cheers,

TJ