What is OpenCV

What is opencv library ?

Open Source Computer Vision Library (OpenCV) is a open source computer vision and machine learning software library. 

OpenCV is a BSD-licensed product, since it is BSD licenses it can be utilized or modified for anyOpenCV businesses use. Sikuli has leveraged OpenCV for image recognition.

OpenCV was built to provide a common infrastructure for computer vision applications 

OpenCV helps to accelerate the use of machine perception in the commercial products. 

How does Karate framework work

What is Karate Framework and API test automation is done using Karate ?

Overview

Karate framework is the only framework that combines API, Web Automation, mock and performance testing using Gatling. It supports some level of RPA/RDA testing by integrating Sikuli with it’s scritps.

Stackoverflow links related with Karate framework

https://stackoverflow.com/questions/59768331/like-selenium-grid-hub-node-is-there-any-option-to-run-karatedriver-on-grid

https://stackoverflow.com/questions/58854004/karate-driver-synchronization-challeges

https://stackoverflow.com/questions/58783547/karate-driver-connection-refused-error-while-using-driver-type-chrome-and-exec

https://stackoverflow.com/questions/58634921/calling-karate-feature-files-based-on-soap-response-status-code-200-or-500

Karate framework can be build using gradle or maven. If you already know Cucumber framework it is easy to learn Karate framework. Karate uses feature files and Karate specific DSL supports both API and Web automation. Karate’s Java runner file can call the feature file having Karate DSL to perform API transactions like GET, POST, PUT and DELETE.

Karate version 0.9.5 released in 2020 has the following features,

  1. Debug from Visual Source code IDE
  2. Hot reload, step over / into / out / back

In 2019, Karate started web automation. Karate 0.9.5 feature will make Karate as complete test automation framework supporting both API and Web automation. Also another point to be noted is Karate’s integration with Sikulix for Desktop automation, integration with Gatling for performance testing and Mocking support for API testing.

What is Coronavirus

What is Coronavirus ?

Coronavirus is a set of virus that affect mammals with moderate to life threatening conditions. In human’s it causes respiratory issues and can cause dealth to vulnerable individuals. In Cows it may cause diarrhea where as chicken can have respiratory infections.

Performance testing tutorial

Performance testing tutorial – Advanced.

Jmeter Performance test scenario – Creating a Jmeter Performance test scenario

Thread Group: Thread group is the number of virtual users performing the transaction on application under test.

How to add Thread group?

  1. Right click on the TestPlan
  2. Select Add>Thread Group from the popup.

Performance testing best practices and activities.

Performance testing best practices and activities.

  1. As first step, Performance Engineer needs to learn the requirements, performance expectations & system architecture.

Note: To learn the performance requirements & expectations, SME (Subject matter expert ) or production user can help. This information will help to define performance goals and SLAs

  1. Then develop best matching performance test scenarios, approach, define goals (SLAs) & sign off test plan.

Note 1: To identify the right performance test scenarios, SME can give some feedback on about the current performance issues in production / live application that he/she is facing.

Note 2:  You can refer another blog of mine on different types of performance scenarios – click link load testing vs performance testing vs stress testing

  1. Now Performance Engineer can developer V– USER scripts and execute the scripts in Controller to generate performance analysis results

Note 1: Apart from delivering performance analysis results, Performance Engineer  can coordinate with other team to monitor real time performance on Database server, Application server and also make sure load balancing is working fine while stress testing.

Some of the e.g. when performance testing is needed

  1. for Database upgrade,
  2. Application upgrade,
  3. Or if user complains that application performance is bad – like page response is not meeting his/her expectations.

Performance testing vs Load testing vs Stress testing vs Endurance testing

1. Performance testing – The main purpose of Performance testing is to arrive the benchmark & baseline of the system behavior (e.g response time) under normal/moderate load. This test will help performance engineer  to analyse how does the application behave under normal conditions.

2. Load testing  – here load will be constantly and steadily increased over a given period of time. i.e the constant load applied for a constant period of time. For example a load of 100 users are applied for 15 min.

3. Stress test – it is meant to push the system beyond the normal load limits or extreme conditions. This test is to make sure the servers don’t crash or what point it crashes. Stress test will  verify the breaking point of the system or how much load, system can withstand.

For example a load of 100 users are applied for 15 min and then 150 users load is applied for next 15 min. then 200 users load is applied for next 15 min. Verify at what point system stopped to respond.

4. Endurance testing – for easy understanding, I would say it is a “Load testing on extended period” to make sure web servers are performing longer period of time. For example a load of 100 users are applied for 48 hours

Note: Once the performance testing is completed successfully, tester can assume the performance requirements are met and he can start load testing. After that Stress testing if required.

Load testing tools in the market are

1) HPE LoadRunner is from Hewlett Packard Enterprise.

2) JMeter – Apache JMeter. It is a Java based performance testing tool works on web communication layer (HTTP)

Summary about Jmeter and performance testing

Jmeter recording

How to create Jmeter scripts?

Recording Jmeter scripts using Jmeter’s HTTP(S) Test Script recorder. There are two ways

1)      Manually adding scripts ( Test plan >> Tread Group >> Add>> Sampler >> HTTP Request )

2)      Recording using Jmeter’s HTTP(S) Test Script recorder

How to record Jmeter scripts using HTTP(S) Test Script recorder

Prior doing that we need to configure browser and learn about the Proxy setup

Jmeter to Application server communication need to be routed through a browser Proxy for this recording purpose. For that you may need to select the Browser (here we can use Firefox browser”

1)      Navigate to Firefox >> Tools >> options >> Advanced >> Network >> Settings

2)      Select Manual Proxy configuration >> HTTP Proxy = localhost & Port = 8080

How to run Jmeter in Jenkins

steps:

Jenkins setup and performance plugin setup:
1) copy performance plugin into Jenkin’s home directry before you start the test.
2) to do that – you can download the performance plugin “performance.hpi” from the site https://wiki.jenkins-ci.org/display/JENKINS/Performance+Plugin
3) how to find the home directry of jenkins – to do that you can navigate to jenkins home page (localhost:8080) and then
4) click on “Manage Jenkins” and then click on “Configure system” the you will notice “Home directy” path in there.

Configure Jmeter and create a basic script in Jmeter:
5) download Jmeter Binary zip file from Jmeter site http://jmeter.apache.org/download_jmeter.cgi
6) unzip it and go to the “bin” directory of the Jmeter folder, wherre you will notice “user.properties” file.
7) open the file in notepad or notepad++ or any other text editor
8) add a line “jmeter.save.saveservice.output_format=xml” to that. Save and close the “user.properties” file
9) create a Jmeter script and make sure you can run it in non GUI mode i.e either in DOS mode or using shell scripts in MAC (note down the commands used in respective OS and it could be used in Jenkins job setup)
Note: for windows command line run, you can use the following commands

C:\[JMETER BIN directory]\jmeter.bat -Jjmeter.save.saveservice.output_format=xml -n -t C:\[JMETER script “.jmx” file] -l Jmeter_test_results.jtl

Note 1: For detailed topics on Jmeter scripts creation , please visit Jmeter , Jmeter recording 

setup Jenkin’s job to run Jmeter scripts
9) go to Jenkins home page (localhost:8080) and then click on “New Item” on “Freestyle project”
10) in the “New item” page, give some name in the item name field and go to below to section “Build” and add build step
11) add build step can be either a) “execute windows batch command” for windows or b) “Execute shell” for MAC
12) provide your command in there and save.
13) Click on “Build now” which would call the Jmeter (jmx) file and run the program
14) after the run, you can verify the Jenkins console to review the results.

What is Rendezvous point with reference to performance testing

Rendezvous point is Synchronization or Wait point. Rendezvous points makes Vusers to wait during test execution and multiple Vusers will simultaneously perform a task.

Rendezvous is mainly used to emulate heavy load on a particular scenario/ transaction to test the application behavior.

How to test the latency issues in Microsoft windows version upgrades

Latency issues generally occurs as a side effects of patch updates in windows. It may occur as audio/video streaming performance issues.
Latency issues can be tested using LatencyMon or Thesycon
Note : Thesycon is more effective on lower versions on windows like 7 or lower.

Web server vs Application server vs Database server

Web server serves a web content (HTML and static content) over the HTTP protocol.

Application server is a container on which one can build and expose business logic and processes to client applications through various protocols like HTTP. Some cases it will have internal web server. Application server is heavy in terms of resource usage.

Database server refers to the back-end system of a database application using client/server architecture. The database server performs tasks such as data analysis, storage, data manipulation, archiving, and other non-user specific tasks

What is Web server?

A Web server can process HTTP requests and respond with HTML pages, provided the requests are handled by server side programs

It uses HTTP protocol to transmit the request/responses. Here Web server handled both request/response and business logic. This is more rigid design.

A web transaction using web server will be like this as below,

Browser (click operation to display some results on a grid> ==> Request goes to web server (Apache HTTP server) ==> Database

Apache Jmeter key topics for basic level users.

Performance testing – Jmeter recording steps

Performance testing – load balancing

Performance testing – Load runner

Selenium Tutorial

Selenium and Jenkins

Selenium features as below

 Selenium supports Cross Browser Testing. The Selenium tests can be run on multiple browsers and multiple machines and multiple Operating systems.

Supports several scripting languages like Java, Python, C#, and PHP.

Selenium uses Browser native commands. It locates and actions applied on UI elements,

Reporting are very easy and extensible.

TestNG quick summary:

 TestNG’s is Selenium + reporting features. It is easy to generate reports using Listeners and Reporters in TestNG

 Features of TestNG includes the following,

1)      Annotations – please refer my annotation blog Annotation – TestNG’s test case priority

2)      Supports parameterization/ data driven testing

3)      Test cases can be grouped and parallel testing is allowed.

Automaton testing using Cucumber – Behavior driven development (BDD)

Application behavior is the main focus on BDD. The requirements are written in English which gives more readability and understandability of the requirement.

So any roles in the company (Tester, developer, end user, and techno functional person) can read it and understand it. Also this will reduce the complication in terms of missing requirement or misrepresenting or misunderstanding requirements between different roles (Developer /tester / end user)

Gherkin is a business readable language – refer below for an example. Below feature file is integrated with Selenium and are having user stories as below.

Please refer below – “feature, Scenario, Given, When, And, Then “are the Keywords below to understand on how to write a feature file.

Selenium jenkins integration steps are as below:

Jenkin related steps:
1) start jenkins by running command in DOS prompt (detailed steps in here )
2) then make sure you are able to access url : localhost:8080
3) then you need to configure jenkins to run the selenium scripts – for that click on “Manage Jenkins”
4) then click on Configure systems
5) Find out the jdk files are installed (usually in C:\ program files … folder path) and copy paste the path in JDK section “JDK Installations” in ” Configure systems” which you are already in.
6) Give JDK name “JAVA_HOME” and provide Java path below in the next field.Selenium related steps:
3) Open eclipse IDE and start new Java project
4) make sure you added selenium jars (Selenium server standalone jar file which you can download add to new project) to support selenium framework for your automation testing.
5) then create a simple selenium script – make sure it is running and completing successfully in Eclipse.
6) Also create a xml file give a name “Xml1.xml”  Make sure Run “Xml1.xml” as “TestNG Suite” is working fine in Eclipse. Also notedown the xml file path in selenium project. create a lib folder in that and add all jar files which are required.Commmand prompt:
7) navigate to that project folder in command prompt and set all required classpath like bin and lib etc which are already in xml file folder in selenium project which you got from selenium project in eclipse.
8) then type command “Java org.testng.testNG Xml1.xml” which will display results in command prompt/DOS screen
9) now create a batch file “Batch1.bat” which contains the above command and also a command for compiling as e.g “java -cp bin;lib/* org.testng.testNG Xml1.xml”Jenkins setup to build and run the file:
10) in Jenkins, create a “new item” with selection of “Freestyle project”
11) then select “Advance options” and put the Selenium project home directory path in there.
12) the build trigger section, select Batch file execution option in there, then put the batch file name “Batch1.bat”
13) click and save the new item
14) click on “Build Now” and verify the “Console output”

How to configure Hub & Node machines for selenium parallel test execution
Configuring Hub machine

1) Start the command prompt/DOS prompt

2) Navigate to the folder location where the Selenium server jar file is kept.

3) Type java –jar selenium-server-standalone-[VERSION].jar –role hub

Note: [VERSION] is the one your downloaded version of selenium-server-standalone Jar file.

Your will see the below screen

Selenium Hub
Selenium Hub

4) Now type: http://localhost:4444 in browser

Your will see the below screen

5) Now type: http://localhost:4444/console in browser

You will see the below screen

Console

Configuring Node machines

Follow the same steps 1 to 2 in node machines

Then type,

Java –jar selenium-server-standalone-[VERSION].jar –role node –hub http://yourHUBmachineIP:4444/grid/register

Selenium Node

What is TestRunner in Cucumber

In order to link Cucumber with Selenium WebDriver, you need to start a Java project in eclipse IDE.

Then, add both Cucumber and Selenium jar files

Write test runner code and execute the same . Please refer BDD testing details on Selenium Cucumber

What is Pester

What is Pester Unit testing framework ?

Pester is a Unit testing framework for Powershell development. Pester can be downloaded from Github project and imported to Powershell as a module. 
Pester uses a bunch of keywords and assertions to evaluate the code quality.Developer could follow TDD approach which is Test driven Development where Developers first write the test based on requirement and then write the development code. Initially test fails and then development code correction done to make the unit test pass.

What is Findfailed exception in Sikuli

What is Sikul and Findfailed error in Sikuli ?

Sikuli is a GUI automation tool or library that uses images of the object to be automated from any given screen.
So these images are manually pre captured and stored in Sikuli automation framework if you are coding using Eclipse Java for Sikuli implementation.
After capturing the screen images, if you change windows screen resolution, Sikuli may give exceptions while execution and that error will be FindFailed exception. These exceptions will be displayed in error log or console of your IDE.

Sikuli Overview

Sikuli is a Desktop Automation library. This library “sikulixapi.jar” can be imported to any Java Selenium project to automate any desktop app or popup.
Sikuli uses “Screen” Class and it has lots of methods to support GUI interactions.E.g. Screen s = new Screen();s.click(“imageOfButton.png”);Note: Store imageOfButton.png at java root project folder.
Similarly you could do type, doubleClick, find etc methods provided by Screen class.
Sikuli automation is very simple and can be used to replace many day today tasks on outlook, windows software center installation. With that said sikuli can replace some of the robotic process automation done by many tools like Automation Anywhere, UiPath etc.

What is Sikuli Screen, Region, Pattern ?

Sikuli Screen is a class that has lots methods like click, double click, find etc to interact desktop GUI images.

Region class is to target a rectangular area location on GUI using x,y coordinates and width and height to locate the rectangular area.

Pattern class used for image level scanning support

Sikuli Architecture:

Sikuli scripts have Java library that takes care of mouse and keyboard actions using java.awt.Robot. Apart from this, Sikuli using OpenCV library which is C++ engine connected to Java via JNI. OpenCV is a computer Vision and machine learning library used for image recognition.

What is JNI

JNI is Java Native interface, it is java programming interface used to bridge the Java and other non java programming language like C, C++ application/programming frameworks

A back pain story … :)

Ever since I got a full blown back pain in late 2018, I learned on how to differentiate ‘real back pain’ vs ‘regular back pain’ 🙂 
Chiropractic treatment started since then; the expensive hourly Chiropractic sessions started with a theory behind back pain, a much boring one and I was counting every minute waiting for an actual treatment). As per Chiro guy, my muscle systems are tired as it is constantly working to re-align the bone since brain had sensed a misalignment in the hip area :P. That theory proved wrong miserably when I did a low cost $65 MRI while at India during my much awaited vacation in 2019, one can not get a doctor visit for this amount in United States !!!. Almost one year 2018-19 period , I was following Chiropractor’s direction and theory… with tired ‘muscle and brain’ 🙂

Total cost for one year sessions and medications to reboot my tired muscles (as per Chiro theory) = $1200.

India Trip: First half of the India trip was meant for H1Visa stamping Agenda and second half turned out to be an Ayurveda treatment session. Ayurveda team started telling new theory that your back had developed swelling of disc causing muscle pains. I am ready to buy this theory as I noticed back pain triggered right after a much ‘needed’ “Flu Shot” for Winter season. The verdict is 3 weeks traction and oil massage (using heated ‘kizhi’) – refer amazon they know what is kizhi and kizhi products 🙂
My second half of trip has got only 1 week allocated time and could not complete treatment. Came back to US with partial treatment and medications weighing almost 2 pounds. I was advised to finish these medications in a month 🙂

My Findings ! : Finally a good thing happened, I noticed an ad on internet. Thanks to Google and Facebook who is using their AI skills and were peeping at my internet search history !! The product is amazing and reduced my back pain in 2-3 days to no-pain !!!
Amazon link : https://www.amazon.com/dp/B06ZZWZL2F/ref=cm_sw_r_wa_apa_i_hV6hEbYYGYGA8

Then I understood the right path that I need to follow and second product came to my home from Amazon. Second product removed the cause of pain while the first one got rid off the pain itself !
Amazon link : https://www.amazon.com/gp/aw/d/B07ZRJZXF7?psc=1&ref=ppx_pop_mob_b_asin_image

PS: As you know when you watch a horror movie, they end with a hint on next series. I never know when a “Back pain story returns…:)” 

Disclaimer : This is based on my experience and not a medical advice. You should always seek the advice of your physician or any other qualified health provider with any questions or concerns you may have regarding your health.