Thursday, April 30, 2020
Git Checkout, Switch, Restore, Origin, Master
Configuring the Global User Name & Password in Git
git clone http://pradeep.kumar:Password01*@10.0.0.51:8080/tfs/Collection/ProjectA/_git/QA_Automation_Project
git config --global user.email pradeep.exe@gmail.com
git config --global user.name "pradeep.exe"
Terminologies:
https://www.git-tower.com/learn/git/glossary/origin/
Origin = In Git, "origin" is a shorthand name for the remote repository that a project was originally cloned from. More precisely, it is used instead of that original repository's URL - and thereby makes referencing much easier.
Here the origin is https://github.com/gittower/git-crash-course.git
https://www.git-tower.com/learn/git/glossary/master/
After cloning (downloading) a project from a remote server, the resulting local repository has a single local branch: the so-called "master" branch.
rebase:
https://www.git-tower.com/learn/git/glossary/rebase/
It is an alternative to the better known "merge" command.
rebase differs from merge by rewriting the commit history in order to produce a straight, linear succession of commits
Head:
https://www.git-tower.com/learn/git/glossary/head/
When working with Git, only one branch can be checked out at a time - and this is what's called the "HEAD" branch. Often, this is also referred to as the "active" or "current" branch.
git checkout -b <branchName>
Read this article:
https://stackoverflow.com/questions/57265785/whats-the-difference-between-git-switch-and-git-checkout-branch
https://www.quora.com/What-is-origin-and-master-in-git
As we are using git checkout for both restore and switching branch,
git checkout <filename> , will undo the unstaged stages
git checkout <branchname> switches branches.
They added seperate commands for restore and switch
git switch
git restore
origin : remote
Master : local
when we clone, a default master branch will be created locally.
HEAD is the snapshot of your last commit.
https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches
https://stackoverflow.com/questions/57265785/whats-the-difference-between-git-switch-and-git-checkout-branch
https://www.quora.com/What-is-origin-and-master-in-git
As we are using git checkout for both restore and switching branch,
git checkout <filename> , will undo the unstaged stages
git checkout <branchname> switches branches.
They added seperate commands for restore and switch
git switch
git restore
origin : remote
Master : local
when we clone, a default master branch will be created locally.
HEAD is the snapshot of your last commit.
https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches
Wednesday, April 29, 2020
Tuesday, April 28, 2020
Chrome vs Chromium : Chromium is the open source project which chrome browser uses.
https://opensource.stackexchange.com/questions/553/how-do-chromium-and-chrome-relate-to-each-other
Chrome added proprietor changes to DRM model and codec support for h264 video
Local testing with cloud testing providers
Local testing: Testing internal servers, Private servers or staging environments on the cloud providers. Like SauceLabs, BrowserStack.com , https://crossbrowsertesting.com/
Monday, April 27, 2020
TestProject.io : ios iphone app testing in Windows 10 operating system
testproject.io
https://www.youtube.com/watch?v=MsgX5oNAh7k&list=PLhW3qG5bs-L_QuqpGY-B-1ifP1j4ve3fx
https://www.youtube.com/watch?v=Jz60Tmwm30g
Test Project is an one stop automation testing tool to support platforms such as
Supported Agents :
Windows
Mac
Linux
Mobile Automation testing for Android
New Test --> Mobile Tests
Agents --> View Device [ Mobile should be connected via USB to the Agent]
Test Project --> Local Agent --> Devices
New Test --> Mobile Test
Select Android or iOS
all the registered application is listed.
Add a new application -->From Device
Native--> Shows all applications installed in the i-phone.
Upload apk: Drag and drop
Add Manually: Package : com.google.youtube
Activity: ...............................
Record Shift+Shift
Actions:
Validations:
Attributes
Save and Exit.
Jobs can be created later execution.
Hybrid application:
Test project officially does not support hybrid application.
Upload apk: andorid-debug.apk
Record
Installation and configuration ot test project test agent .
Download testprojectAgent_x64
install .exe
start agent t--> finish
c:\program files \testproject agent --> all folders we can see here.
Now registration of new agent into
Mange agents
register agent
Agent_Win10Name
Register
Add Job--> Web --> agent selection --> all browsers installed in agent.
Top 5 features
SDK: we can write code, currently support Java & C#. we can control the physical devices from the testproject.io
8. Mobile Automation testing for iOS application.
Architecture
[TestProject]--Https JSON object-->[Test Project Agent] ------TCP/IP JSON Object -->[Customized web Driver agent]
[TestProject] - running in cloud.
[Test Project Agent] -Local Machine
[Customized web Driver agent] - iPAD
configuration Pre-requisete:
Activate apple developer account.
1) this will give you to get your device certificate and provisioning profile.
2) you can get the CSR file from Test Project portal and generate the file to get device certificate provisioning profile
iOS: Apple team id [ Developer Id]
1) CSR : Certificate signing request
2) Device certificate
3) Provisioning Profile
Agent: Download and agent MAC and install. Register the agent.
Record and playback IOS with physical device.
Newtest --> Mobile Test --. TestNameXYZ
ios--> Add a new application --> Connected Device --> Select Device for testing.
Fromm Device: Gaspy (open this app, New Zealand petrol bunk)
Running iOS mobile app in windows 10.
Agent should be started, connect physical i-phone device. Record and playback.
Create test package
Page Object Model(Java) --> Test the coded test in local machine --> Package the test .JAR and upload in Test Package--> Consume the test package in any respective recorded tests.
Test package --> Upload test package
Using Intellij IDE
New-Project ---> Java
Create a .jar Maven file
and upload .jar file.
Red highlight are same file.
https://www.youtube.com/watch?v=MsgX5oNAh7k&list=PLhW3qG5bs-L_QuqpGY-B-1ifP1j4ve3fx
https://www.youtube.com/watch?v=Jz60Tmwm30g
Test Project is an one stop automation testing tool to support platforms such as
- Windows
- Macos
- Linux
- iOS
- Android
- Web-services
Supported Agents :
Windows
Mac
Linux
Mobile Automation testing for Android
New Test --> Mobile Tests
Agents --> View Device [ Mobile should be connected via USB to the Agent]
Test Project --> Local Agent --> Devices
New Test --> Mobile Test
Select Android or iOS
all the registered application is listed.
Add a new application -->From Device
Native--> Shows all applications installed in the i-phone.
Upload apk: Drag and drop
Add Manually: Package : com.google.youtube
Activity: ...............................
Record Shift+Shift
Actions:
Validations:
Attributes
Save and Exit.
Jobs can be created later execution.
Hybrid application:
Test project officially does not support hybrid application.
Upload apk: andorid-debug.apk
Record
Installation and configuration ot test project test agent .
Download testprojectAgent_x64
install .exe
start agent t--> finish
c:\program files \testproject agent --> all folders we can see here.
Now registration of new agent into
Mange agents
register agent
Agent_Win10Name
Register
Add Job--> Web --> agent selection --> all browsers installed in agent.
Top 5 features
SDK: we can write code, currently support Java & C#. we can control the physical devices from the testproject.io
8. Mobile Automation testing for iOS application.
Architecture
[TestProject]--Https JSON object-->[Test Project Agent] ------TCP/IP JSON Object -->[Customized web Driver agent]
[TestProject] - running in cloud.
[Test Project Agent] -Local Machine
[Customized web Driver agent] - iPAD
configuration Pre-requisete:
Activate apple developer account.
1) this will give you to get your device certificate and provisioning profile.
2) you can get the CSR file from Test Project portal and generate the file to get device certificate provisioning profile
iOS: Apple team id [ Developer Id]
1) CSR : Certificate signing request
2) Device certificate
3) Provisioning Profile
Agent: Download and agent MAC and install. Register the agent.
Record and playback IOS with physical device.
Newtest --> Mobile Test --. TestNameXYZ
ios--> Add a new application --> Connected Device --> Select Device for testing.
Fromm Device: Gaspy (open this app, New Zealand petrol bunk)
Running iOS mobile app in windows 10.
Agent should be started, connect physical i-phone device. Record and playback.
Create test package
Page Object Model(Java) --> Test the coded test in local machine --> Package the test .JAR and upload in Test Package--> Consume the test package in any respective recorded tests.
Test package --> Upload test package
Using Intellij IDE
New-Project ---> Java
Create a .jar Maven file
and upload .jar file.
Red highlight are same file.
Sunday, April 26, 2020
Saturday, April 25, 2020
Wednesday, April 22, 2020
Android Simulator vs Emulator :
https://medium.com/@sarahelson81/difference-between-emulator-vs-simulator-for-mobile-testing-lambdatest-1bafd83fdd85
Simulation (Partial Implementation of Original Device) : Imitation of only software part which is developed for Mobile in System. Ex: Any app
Emulator(Complete Implementation of Original Device) : Imitation of Complete Mobile (all hardware, firmware & software components) in the system. Here it will take RAM, CPU also into consideration.
Simulation (Partial Implementation of Original Device) : Imitation of only software part which is developed for Mobile in System. Ex: Any app
Emulator(Complete Implementation of Original Device) : Imitation of Complete Mobile (all hardware, firmware & software components) in the system. Here it will take RAM, CPU also into consideration.
Appium- Desired capabilities to Change Language : Only in Simulator and Emulator : No Real Device
It does not supported for Real Devices per official Appium docs
https://stackoverflow.com/questions/49449221/changing-language-via-appium-capabilities-on-android-api-23
https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
https://stackoverflow.com/questions/49449221/changing-language-via-appium-capabilities-on-android-api-23
https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
Appium Desktop Inspector: Chrome Browser
https://stackoverflow.com/questions/58696488/how-to-resolve-cannot-call-non-w3c-standard-command-while-in-w3c-mode-in-case
{ "deviceName": "vivo 1920", "udid": "575b6cf1", "platformName": "Android", "platformVersion": "9", "chromedriverExecutableDir": "D:\\picx\\81", "appActivity": "com.google.android.apps.chrome.Main", "appPackage": "com.android.chrome" }
Java code
package test1; import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; import java.net.URL; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.AppiumDriver; import io.appium.java_client.MobileElement; import io.appium.java_client.remote.MobileCapabilityType; public class ChromeExample { //Any of the below code works fine //static AppiumDriver<MobileElement> appDriver; static WebDriver appDriver; @Test public static void OpenChromeBrowser() throws Exception { DesiredCapabilities cap = new DesiredCapabilities(); cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android"); cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9"); cap.setCapability(MobileCapabilityType.DEVICE_NAME, "vivo 1920"); cap.setCapability(MobileCapabilityType.UDID, "575b6cf1"); cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "60"); cap.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome"); cap.setCapability("chromedriverExecutableDir", "D:\\picx\\81"); cap.setCapability("appium:chromeOptions", ImmutableMap.of("w3c", false)); URL url = new URL("http://127.0.0.1:4723/wd/hub"); appDriver = new AppiumDriver<MobileElement>(url,cap); System.out.print("Opened Chrome Browser"); appDriver.get("https://www.google.com"); WebElement elem = appDriver.findElement(By.name("q")); //WebElement elem1 = appDriver.findElement(By.name("q")); this code also works fine elem.sendKeys("learn"); elem.sendKeys(Keys.ENTER); } }
Tuesday, April 21, 2020
Monday, April 20, 2020
Saturday, April 18, 2020
Friday, April 17, 2020
Native, Hybrid apps : iOS apps will not run on Android and vice versa
https://www.mobiloud.com/blog/native-web-or-hybrid-apps/
Most web apps are written mainly in Javascript
Native apps , same language used in operating system development.
For ex:
Swift or Objective-C for iOS apps - Xcode IDE
Java is used to write native Android apps - Android Studio IDE
C# for the most part for Windows Phone apps.
Building Cross-Platform Native Apps
Xamarin, React Native, Titanium, and Google’s Flutter
Hybrid Apps:
You install it like a native app, but it’s actually a web app on the inside.
Most web apps are written mainly in Javascript
Native apps , same language used in operating system development.
For ex:
Swift or Objective-C for iOS apps - Xcode IDE
Java is used to write native Android apps - Android Studio IDE
C# for the most part for Windows Phone apps.
Building Cross-Platform Native Apps
Xamarin, React Native, Titanium, and Google’s Flutter
Hybrid Apps:
You install it like a native app, but it’s actually a web app on the inside.
Robotium: Mobile UI automation tool , alternative to appium
https://www.guru99.com/first-android-testing.html
Gradle is build automation tool: Gradle is successor of Ant and Maven
https://www.baeldung.com/ant-maven-gradle
https://gradle.org/
https://docs.gradle.org :
https://www.youtube.com/watch?v=Nabjqv8KDgc&list=PLhW3qG5bs-L8kzOvEjaOyUs2LqHZ3fz4X
Gradle:
Build automation tool performs following functionalities,
Common Build tools:
Apache Ant Apache Maven Gradle Grunt Gulp
Install Gradle:
https://gradle.org/install/ 97Mb Zip
Set environment path
https://gradle.org/
https://docs.gradle.org :
https://www.youtube.com/watch?v=Nabjqv8KDgc&list=PLhW3qG5bs-L8kzOvEjaOyUs2LqHZ3fz4X
Gradle:
Build automation tool performs following functionalities,
- compiling code
- packaging into binary code
- Manage required libraries (dependencies)
- Running automated tests
- Deployment
- Notification (sending email)
Common Build tools:
Apache Ant Apache Maven Gradle Grunt Gulp
Install Gradle:
https://gradle.org/install/ 97Mb Zip
Set environment path
Jenkins All : java -jar jenkins.war http://localhost:8080/
Jenkins:
https://serverfault.com/questions/359793/tell-jenkins-to-run-a-specific-project-on-a-particular-slave-node
https://www.studytonight.com/jenkins/jenkins-master-slave-configuration
Thursday, April 16, 2020
JMeter: HTTP Cookie Manager
https://www.blazemeter.com/blog/http-cookie-manager-advanced-usage-a-guide/
first request will not be having any cookies , All the other requests have cookie data in the request header. This means that the cookie is passing from the response to the next request, and it isn’t cleared when a new iteration starts.
JMeter: HTTP Cache Manager
Http Cache manager prevents downloading of the embedded resources like image, scripts, fonts, sytles for consecutive HTTP requests.
if you dont add HTTP Cache Manager to your JMeter test plan. No requests will be cached. Add only if you need to use cache requests.

Cache-Control: no-store ---> it wont cache anything.
Cache-Control: no-cache ---> The no-cache directive means that a browser may cache a response, but must first submit a validation request to an origin server. It uses Last-Modified and Etag of the response header.
Additional HTTP Cache Headers:
Expires: Sat, 13 May 2017 07:00:00 GMT
Expires will be ignored if max-age directive is present.
Etag: 675af34563dc-tr34 -- its like a version number for the served content/Page, this tag number will change if the content is modified in the server. If Request Header's Etag matches with the server page ETag, then cached resource is used. Else server will respond will new resource.
if you dont add HTTP Cache Manager to your JMeter test plan. No requests will be cached. Add only if you need to use cache requests.

Cache-Control: no-store ---> it wont cache anything.
Cache-Control: no-cache ---> The no-cache directive means that a browser may cache a response, but must first submit a validation request to an origin server. It uses Last-Modified and Etag of the response header.
Expires: Sat, 13 May 2017 07:00:00 GMT
Expires will be ignored if max-age directive is present.
Etag: 675af34563dc-tr34 -- its like a version number for the served content/Page, this tag number will change if the content is modified in the server. If Request Header's Etag matches with the server page ETag, then cached resource is used. Else server will respond will new resource.
Jenkins : Job DSL Plugin: Create Jobs with Scripts(Groovy)
https://github.com/alicommit-malp/jenkins_dsl_example
The Pipeline plugins support implementing and integrating continuous delivery pipelines via the Pipeline DSL.
Job DSL with Pipeline DSL both have their own syntax and scope of application. Here explaining Job DSL.
https://updates.jenkins.io/download/plugins/job-dsl/
Add Job DSL Plugin
Add build step:
There are 2 options
1. Use the provided DSL script
2.
Folder path contains DSL script
Build the Job.
A new job will be created.
with this configuration.

The Pipeline plugins support implementing and integrating continuous delivery pipelines via the Pipeline DSL.
Job DSL with Pipeline DSL both have their own syntax and scope of application. Here explaining Job DSL.
https://updates.jenkins.io/download/plugins/job-dsl/
Add Job DSL Plugin
Add build step:
There are 2 options
1. Use the provided DSL script
2.
Folder path contains DSL script
Build the Job.
A new job will be created.
with this configuration.

Wednesday, April 15, 2020
JMeter: Beanshell Sampler
https://www.redline13.com/blog/2018/06/testing-complex-logic-with-jmeter-beanshell/
- SampleResult ,
- ResponseCode,
- ResponseMessage,
- IsSuccess,
- Label,
- FileName,
- ctx,
- vars,
- props,
- log
SampleResult.setThreadName("Test thread1");
log.info(" "+SampleResult.getThreadName());
log.info("Current Sampler class is: " + ctx.getCurrentSampler());
log.info("JMeter Engine class is: " + ctx.getEngine());
log.info("Thread Name is: " + ctx.getThread().getThreadName());
log.info("Thread Start Time is: " + ctx.getThread().getStartTime());
log.info("Thread End Time is: " + ctx.getThread().getEndTime());
log.info("Start Next Thread Loop on Error: " + ctx.getThreadGroup().getOnErrorStartNextLoop());
log.info("Stop Test on Error: " + ctx.getThreadGroup().getOnErrorStopTest());
JMeter: jp@gc - Set Variables Action (Plugin) : Add local variables inside thread group.
https://www.blazemeter.com/blog/introducing-the-set-variables-action-component-in-jmeter/
Install plugin:
Add a test plan as shown below to validate the variables action plugin functionality.
here
number = 1111111111111111111111111111111
here number is override by 222222222222222222222222222
now i have used number variable again and name = pradeep
number = 33333333333333333333333333333
name = pradeep

if we delete number here, it will retain from previous then
number = 222222222222222222222222
JMeter : Dummy sampler : for Post Processors verification in Offline mode. (Mock request and Response)
https://www.blazemeter.com/blog/jmeters-dummy-sampler-the-ultimate-guide/
Add dummy sampler plugin
Add Request Data
Mainly Response Data -(we use Post processor to validate )
Add JSON Extractor Post processor
Execute:
Add Debug Sampler to capture variable values
Execute:
name = Seatle
JMeter: Redirect Automatically , Follow Redirects: measure URL Redirection ?
https://www.youtube.com/watch?v=DciZ7uqsh0k&list=PLJ9A48W0kpRIC_2PUr3b4ulb3ajrKgiGT&index=5
if we open http://www.google.co.in it redirects to https://www.google.co.in site.
Redirect Automatically , Follow Redirects are mutually exclusive. We can select either of these,
Redirect Automatically : Hit url and redirection is captured in single request.
Follow Redirects : Captures http://www.google.co.in as one request and redirection to https://www.google.co.in as another request.
in View Results in Table : Select Child Samples
JMeter : Bolt (Network Protocol) : Neo4J Graphical Database performance testing.
https://dev.to/qainsights/performance-testing-neo4j-database-using-bolt-protocol-in-apache-jmeter-1oa9
Using Bolt we can do load testing for Neo4J Graphical database.
Prerequiest: Download Community edition Neo4J Zip , run the batch file. Create a dummy graphical data.
Add Thread Group,
Bolt Connection Configuration:
Bolt Request
Listener : View Result Tree
Execute :
Using Bolt we can do load testing for Neo4J Graphical database.
Prerequiest: Download Community edition Neo4J Zip , run the batch file. Create a dummy graphical data.
Add Thread Group,
Bolt Connection Configuration:
Bolt Request
Listener : View Result Tree
Execute :
Subscribe to:
Posts (Atom)
JMeter Simple Controller
Simple Controller is just a container for user request.
-
We can convert in 2 ways. 1 . online tool http://editor.swagger.io/#/ 2. Go to https://swagger.io/docs/open-source-tools/swagger-c...
-
to invoke Notepad on Windows and open the JMeter readme in it, configure the OS Process Sampler as the following: Command: notepad....
-
BeanShell PreProcessor to the sampler import org.apache.jmeter.protocol.http.control.Header; sampler.getHeaderManager().removeHeaderN...