Sunday, December 27, 2020

how to extend HEAP SIZE of jMeter 5.1.1 on Windows 10


https://stackoverflow.com/questions/58259868/how-to-extend-heap-size-of-jmeter-5-1-1-on-windows-10

 

Saturday, December 19, 2020

https://www.codegrepper.com/code-examples/

Visual Resume Builder

 https://app.zety.com/login  Classic application

https://novoresume.com/page/legal/cookie


What is a cookie

https://novoresume.com/page/legal/cookie

What is a cookie

Cookies are text files containing small amounts of information which are downloaded to your device when you visit a website. Cookies are then sent back to the originating website on each subsequent visit, or to another website that recognizes that cookie.

These cookies contain no personally identifiable information but they will use your computer’s IP address to know from where in the world you are accessing the Internet.

Cookies do lots of different jobs, like letting you navigate between pages efficiently, remembering your preferences, and improve the user experience. They can also help to ensure that adverts you see online are more relevant to you and your interests. 

Friday, December 18, 2020

Wednesday, October 21, 2020

Dry Fruits per day

 

https://food.ndtv.com/opinions/the-nutty-affair-just-how-much-of-these-nuts-should-you-be-eating-779321


 

 

 

1

Almonds

8-10

2

Walnuts

2

3

Dates

2

4

Cashew

4-5

5

Pista

5-7

6

Peanuts

8-10


Total quantity should not exceed more than 20 gms  / 25 pieces, suggested to take morning/day time.


Tuesday, October 13, 2020

hamcrest matchers java

 http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matchers.html

Monday, October 12, 2020

JUnit All

To get the JUnit Test option, you should add the following 2 dependencies in the POM.xml

<dependency>

        <groupId>org.junit.jupiter</groupId>

        <artifactId>junit-jupiter-api</artifactId>

        <version>5.4.2</version>

        <scope>test</scope>

    </dependency>

    <dependency>

        <groupId>org.junit.jupiter</groupId>

        <artifactId>junit-jupiter-engine</artifactId>

        <version>5.4.2</version>

        <scope>test</scope>

    </dependency>

Monday, October 5, 2020

Weather app

 https://github.com/ChamichApps/Mock-Response-In-Retrofit-2.0/blob/master/app/src/main/java/com/vavian/mockretrofitrequests/rest/service/FakeInterceptor.java


With java-hamcrest 2.0.0.0 we can use this syntax:

    // import static org.hamcrest.MatcherAssert.assertThat;
    // import org.hamcrest.Matchers;

    BigDecimal a = new BigDecimal("100")
    BigDecimal b = new BigDecimal("100.00")
    assertThat(a,  Matchers.comparesEqualTo(b));
https://mkyong.com/java/jsonassert-how-to-unit-test-json-data/

Retrofit : A type-safe HTTP client for Android and Java.

 https://github.com/square/retrofit

https://square.github.io/retrofit/


Java Faker Library : To create random test data offline.

 

https://www.youtube.com/watch?v=tC9og1H2604&t=210s


Github: https://github.com/dius/java-faker

Documentation : http://dius.github.io/java-faker/apidocs/index.html


Demo Application: https://github.com/codingricky/java-faker-spring-boot

Git link for Demo app:  Its in Cradle make a check.

git clone https://github.com/codingricky/java-faker-spring-boot.git


its supports different languages also called locale


Helpful links:

https://medium.com/@grajeshr97/faker-library-dynamic-data-for-test-automation-25aa2b268790





Monday, September 28, 2020

 


https://requests.readthedocs.io/en/master/user/quickstart/#response-status-codes


test1
    [Tags]  T1  T1A    
    ${abcd}=  requestapi1


from openpyxl import Workbook, load_workbook
from contextlib import closing
import datetime
import time
from robot.libraries.BuiltIn import BuiltIn
import pyautogui
import keyboard
import requests
import os
import urllib3
import random
import win32com.client
from re import search
from cryptography.fernet import Fernet
import json
from datetime import timedelta
from datetime import datetime
from datetime import date

# def make_excel_file(file_name):
#    with closing(Workbook()) as wb:
#        wb.save(file_name)


def requestapi1():
    r = requests.get('https://api.github.com/events')
    return r.text
    
r.url
r.status_code
 response2 = requests.post(testurl2, data=open(
        xmlfilename, 'rb'), headers=headers2, verify=False)
r = requests.post(url, data=json.dumps(payload))

Python commands & Programs

 

pip list


installing package form the text file all. 

pip install -r requirements.txt






pip list




https://stackoverflow.com/questions/29846087/microsoft-visual-c-14-0-is-required-unable-to-find-vcvarsall-bat




Wednesday, September 23, 2020

Selenium Driver url

 https://www.selenium.dev/downloads/

https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

https://chromedriver.chromium.org/downloads


Monday, September 14, 2020

Visual Studio Robot Framework Settings.json , adding intellisense



Adding instellisense


Go to Settings, 
search rfLanguageServer

Edit in Setting.json













{
    "python.testing.unittestArgs": [
        "-v",
        "-s",
        ".",
        "-p",
        "*test.py"
    ],
    "python.testing.pytestArgs": [
        "."
    ],
    "rfLanguageServer.libraries": [
        "BuiltIn-3.0.4",
        "Collections-3.0.4",
        "Dialogs-3.0.4",
        "OperatingSystem-3.0.4",
        "Process-3.0.4",
        "Screenshot-3.0.4",
        "DateTime-3.0.4",
        "SeleniumLibrary-3.2.0",
        "String-3.0.4",
        "Telnet-3.0.4",
        "XML-3.0.4"
    ],
    "bookmarks.navigateThroughAllFiles"true
}

Visual Studio Robot Framework Debugger launch.json



{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version""0.2.0",
    "configurations": [
        {
            "type""robot",
            "request""launch",
            "name""Robotframework Debugger",
            "program""${workspaceFolder}/${relativeFile}",
            "WorkingDirectory""${workspaceFolder}/${relativeFile}",
            "stopOnEntry"false,
            "arguments""",
            "libraries": [],
            "variables": [
                {
                    "Name""Variable",
                    "Value""Value"
                }
            ]
        }
    ]
}

Thursday, September 10, 2020

git fetch --all

https://www.git-tower.com/learn/git/faq/difference-between-git-fetch-git-pull/

Wednesday, September 9, 2020

Python Path in command prompt: where python

where python
https://stackoverflow.com/questions/19829516/how-to-get-python-installed-path-from-command-line





Monday, August 24, 2020

JMeter max user limitation




https://www.blazemeter.com/blog/what%E2%80%99s-the-max-number-of-users-you-can-test-on-jmeter



In conclusion, we can say that you can simulate up to 10,000 users on a JMeter load test even on a regular laptop. This depends on following 4 simple rules:
  • Use JMeter listeners for debugging purposes only
  • Run JMeter performance tests in non-GUI mode
  • Increase JMeter heap space to generate a larger load
  • Use LAN instead of a Wi-Fi connection when running a load test

As you can see, the answer to the question ‘What’s the maximum number of users you can test on JMeter?’ varies. It depends on many factors: test complexity, script running method, internet and machine capabilities and so forth.

I have found the user limit on my local laptop is 8000-9000 users. But what if you need more? There are options to do that:
1. JMeter enables running scripts in distributed mode by using a few slave machines with your own main one, and then combining and outputting the results. With this method you can scripts horizontally without any limitations except for the number of slave machines you allocate for tests.

Saturday, August 22, 2020

Postman tool API testing All

Postman tutorial:

https://www.softwaretestingmaterial.com/postman-tutorial/


Postman assertion:
https://learning.postman.com/docs/writing-scripts/script-references/test-examples/



Pre-requisite script

var random_number1=_.random(1, 100);
var core_Url=pm.environment.get("baseUrl");
var token="Bearer "+pm.environment.get("token") ;
console.log(tok);
const echoPostRequest = {
  url: core_Url+'/api/bookstore',
  method: 'POST',
  header: {
      'content-type':'application/json',
      'Authorization':token
  },
  Authorization:tok ,
  body: {
        mode: 'application/json',
        raw: JSON.stringify
        ({
        "code": "Postman updated"+random_number1,
        "name": "API Postman"+random_number1,
        "description": "ADMT some deee ",
        "sla": "5",
        "enabled": true,        
        "metadata": [],        
        "serviceAccess": ["Public", "Commercial" ],
        "requiredDocuments": []
        })
    }   
};
 
pm.sendRequest(echoPostRequest, function (err, res) {
    console.log("new");
    console.log(err);
    console.log(res);
    //console.log(err ? err : res.json());
    //const dataresponse= res.json();
    //pm.environment.set("ServiceFor_update",dataresponse.data.id);
});






YouTube: 
Raghav pal link

https://www.youtube.com/playlist?list=PLhW3qG5bs-L-oT0GenwPLcJAPD_SiFK3C




Node js Newman command line arguments
newman run collection.json -environment enviornment.json --globals global.json

Passing environment variables in cmd prompt

https://github.com/postmanlabs/newman/blob/develop/README.md#command-line-options

newman run <collection file> -e <environment file>

https://stackoverflow.com/questions/50843024/postman-collection-is-passing-in-postman-runner-but-not-its-failing-in-command


https://learning.postman.com/docs/running-collections/using-newman-cli/command-line-integration-with-newman/


How to run multiple collection in newman:

https://community.postman.com/t/required-to-run-multiple-collection-through-newman/10792/5



https://www.npmjs.com/package/newman-reporter-htmlextra

npm install -g newman-reporter-htmlextra

newman run collection.json -r htmlextra



Exact Steps:


1.      Install Nodejs(https://nodejs.org/en/download/)  : Admin rights required.
2.      Install newman  plugin

3.      Install html extra reporter plugin




Run Collection












JSON schema validation: https://jsonschema.net/home : Tiny Validator :Postman

SSO : Single Sign on authentication

Wednesday, May 27, 2020

Shadow root


https://github.com/sukgu/shadow-automation-selenium

https://stackoverflow.com/questions/55761810/how-to-automate-shadow-dom-elements-using-selenium

https://stackoverflow.com/questions/23920167/accessing-shadow-dom-tree-with-selenium/37253205



IJavaScriptExecutor jse2 = (IJavaScriptExecutor)_driver;
var pdfUrl = jse2.ExecuteScript("return document.querySelector('downloads-manager').shadowRoot.querySelector('downloads-item').shadowRoot.getElementById('file-icon').getAttribute('src')");

Thursday, April 30, 2020

Temporary Email Services: Mailinator

BlueStacks

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

Tuesday, April 28, 2020

LambdaTest : Cross Browser Testing Cloud


Cloud computing is the on-demand availability of computer system resources, especially data storage and computing power,


XCode IDE developing software for macOS, iOS, iPadOS, watchOS, and tvOS


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/

Open Source login: http://ezine.lfymag.com/loginpassefy.asp email r*****3

http://ezines.efyindia.com/

Software Details, Compare, Alternatives and Reviews : https://www.itcentralstation.com/products/appium-alternatives-and-competitors


Example: 

Perfecto Is the Leading Testing Platform for Web & Mobile Apps : https://www.perfecto.io

iOS Mobile app automation

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


  • 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.

















Katalon Recorder: Chrome extension for recording tests




Supported Language

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.

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

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);    
 }

}

JMeter Simple Controller

  Simple Controller is just a  container  for user request.