Image for post
Image for post

How to check a file exists in system:

//we use import java.io.File;
File f = new File("D:\\program.txt");
f.exists(); // this will print true or false whether the file program.txt exists

We can use this logic to check if the file got downloaded and is available at the location.

But sometimes we need to click download button and wait for like few mins or seconds for the download to finish.

so in this case we need to poll for the file till it exists . …


Image for post
Image for post

Issue:

In postman if we check the UI, we notice that there is no way to define file path as variable.


Image for post
Image for post

Install Appium studio:

https://experitest.com/mobile-test-automation/appium-studio/

Enable Developer mode in Oneplus:

Navigate to Settings>About and click Build Number multiple time

<you will get a message pop saying developer mode enabled>

Enabled Remote Debugging:

Goto Settings>System>Developer options>Debugging>USB Debugging and enable it:


https://experitest.com/mobile-test-automation/appium-studio/

Enable Developer mode in Oneplus:

Navigate to Settings>About and click Build Number multiple time

<you will get a message pop saying developer mode enabled>

Enabled Remote Debugging:

Goto Settings>System>Developer options>Debugging>USB Debugging and enable it:

Image for post
Image for post

Now search for device:

Open cmd and run:

adb devices

You will get prompt in phone for authorization accept it:


Image for post
Image for post

Creating Git local repository and connecting with remote repository:

Git init
Git remote add origin <url>
Git config --global user.email <anyemail>.com
Git config --global user.name <anyname>
Git push --set-upstream origin master

Cloning a repository:

git clone <repository_git_url>

Creating new remote branch:

git checkout -b <branch_name> 
git push origin <branch_name>

Delete a remote branch:

git push origin :<branch_name>

Delete a local Branch:

git branch -d branch_name
git branch -D branch_name

Note: -D deletes the branch even if the branch is not pushed yet ( its similar to — delete — force)

How to change the remote URL:

git remote set-url origin…

Image for post
Image for post

Question:

https://sqa.stackexchange.com/questions/42251/how-to-interact-with-ngx-monaco-editor

Answer:

If you are not sure about the locator, then you can use the action class sendKeys method to interact with the field.

Here, it interacts with the active (currently focused ) element.

So the first step is to bring the element to focus, this can be done by just clicking it:

await browser.get('https://stackblitz.com/edit/ngx-monaco-editor-example')      
await browser.sleep(10000)
await $('[class="view-line"]').click()
await browser.sleep(4000)

Now you can see the cursor is at the below place:


Image for post
Image for post
Jenkins tips

What is a pipeline:

It is a way to define the Jenkins workflow as code or in simple words instead of creating freestyle jobs and chaining them through post-build action. We can create the entire pipeline using code written in groovy

What is groovy?

Groovy is powerful, optionally typed and dynamic language to develop an application on Java Platform where its syntax is Java-like. Its typing discipline is strong, static and dynamic. The best things about Groovy are that since it extends JDK, it accepts Java code. Groovy can be used as both programming and scripting Language. Groovy is a superset of Java which means Java program will run in Groovy environment but vice-versa may or may not be possible. Whereas Java is strongly and statically typed programming language.


Intro:

If you just want to know how to setup UI and not about setting up VM, scroll to the section : Installing GUI. Let’s startttttttttttt……………..

Prerequisite:

To create new VM:

In VMware workstation click ‘File> Create VM’ and choose custom option.

Image for post
Image for post

Select ESXi 6.5 from dropdwon to ensure compatibility with previous versions.


CSV:

a,b,c
1,2,3
1,5,6
2,4,6

CSV parse output:

Image for post
Image for post

Approach 1: store CSV content as an environmental variable

Just copy the CSV file content and create an environmental variable and paste the content inside it

Then in test or pre-requisite step:

console.log(pm.environment.get("data"))
const parse = require('csv-parse/lib/sync')
//Environmental variable where we copy-pasted the csv content
const input =pm.environment.get("data");
const records = parse(input, { columns: true, skip_empty_lines: true})
console.log(records)

Approach 2: Passing the CSV content to an environmental variable through Newman (Powershell):

Then in test or pre-requisite step use the same code as above:

> $a= Get-Content -raw .\1.csv> newman run .\test.postman_collection.json -e .\test.postman_environment.json -k -r "cli,htmlextra" --env-var data=$a

Image for post
Image for post

The right way is to use custom formatter (Plugins)

So what does this means ?

We are going to create our own report plugin using Extent report.

As in TestNG reporting, where we override the TestNG listeners to tell TestNG what to do for each action or events,

Here, we implements Cucumber listener class to listen to cucumber events and tell it what to do for each event.

Cucumber sends events for each action like scenario started, step started, step finished etc to this instance of the listener. …

About

Praveen David Mathew

An ISTQB certified Software Test Engineer and an enthusiastic fast learner with a passion for technology. linkedin : https://www.linkedin.com/in/praveendvd

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store