Total Pageviews
Thursday, 30 July 2020
Friday, 24 July 2020
Input Values Using JavaScript
if there is no value attribute in DOM for element the use
((JavascriptExecutor) getDriver()).executeScript("arguments[0].innerHTML='YOUR-VALUE-IN-SINGLEQUOT'",driver.findElement(By.xpath("//input[@id='xdc']")));
if there is value attribute defined in DOM then use
((JavascriptExecutor) getDriver()).executeScript("arguments[0].value='YOUR-VALUE-IN-SINGLEQUOT'",driver.findElement(By.xpath("//input[@id='xdc']")));
Sometimes in some applications .. like the application which are based on extJS framework the dom changes after performing some actions . For example
Here we see for the cell DOM looks as highlighted .
If we double click on it to enable it then the DOM changes like ..
But using automation if we locate this element and try to send keys using selenium then it will throw selenium exception -- Element Not Intractable
That's one of the pain with extJS application while automating using selenium which occurs sometimes.
Now if you will right click on cell and select inspect
You will find a new element has been introduced in DOM to input values which earlier was not present.
So to insert value in scenarios like this you will fill first have to perform double click and then locate the element which appears later and send keys to it.
Tuesday, 30 June 2020
Sample Cucumber API TestCases
Steps To Test API
Step#1 Get Swagger document from Dev
Step#2 Write TCs based on document as TCs
Step#3 Get the TCs reviewed
Step#4 Execute the TCs in PostMan (Create Collection in PostMan for this execution if possible)
Step#5 Take screenshot of Postman execution response and response from DB in a document
Step#6 Attach screenshot document + Postman collection + swagger doc in story
Step#7 Mark story Done and assign to PO
Step#8 Automate apis
Wednesday, 20 May 2020
Saturday, 16 May 2020
Browser Automation Without Using Selenium Language Bindings
We will see :
1> Selenium Architecture
2> How language bindings issue command to browser driver and how browser driver performs those actions on actual browsers
3> Using selenium end points in postman
4> Creating postman collection to automate some steps
Download postman collection from
Save Water | Save Energy | Save Earth
Stop Pollution | Stop Plastic
Spread Peace
Tuesday, 21 April 2020
How To Perform Bulk Operation In JIRA
In this video we will see how to perform bulk operation in JIRA like bulk subtask creation in stories or like bulk status change of a ticket etc.
You can download macro from : swachalantech EXCEL MACROSave Water | Save Energy | Save EarthStop Pollution | Stop PlasticSpread Peace
Wednesday, 25 March 2020
How to take full page screenshot in serenity bdd WITHOUT USING THIRD PARTY JARS OR LIBRARIES
Some times we need to take full page screenshot in case of failures. In this post we will see how to take full page screenshots without using third party jars like Ashot , Shutterbug etc.
Use the below code and call it whenever u need to take full page screenshot.
In serenity report we will see full page screenshots like below :
Code:
public void takeFullPageScreenShot() {
try {
int heightInner = Integer
.parseInt(((JavascriptExecutor) getDriver()).executeScript("return window.innerHeight").toString());
int heightTotal = Integer.parseInt(((JavascriptExecutor) getDriver())
.executeScript("return document.documentElement.scrollHeight").toString());
int scrollInitial = 0;
int scrollFinal = heightInner - 150;
((JavascriptExecutor) getDriver())
.executeScript("window.scrollBy(0,-" + Integer.toString(heightTotal) + ")");
for (int i = 0; i < (heightTotal / scrollFinal); i++) {
Serenity.takeScreenshot();
((JavascriptExecutor) getDriver()).executeScript(
"window.scrollBy(" + Integer.toString(scrollInitial) + "," + Integer.toString(scrollFinal) + ")");
}
} catch (Exception e) {
logger.info(e.getMessage());
}
}
Use the below code and call it whenever u need to take full page screenshot.
In serenity report we will see full page screenshots like below :
Code:
public void takeFullPageScreenShot() {
try {
int heightInner = Integer
.parseInt(((JavascriptExecutor) getDriver()).executeScript("return window.innerHeight").toString());
int heightTotal = Integer.parseInt(((JavascriptExecutor) getDriver())
.executeScript("return document.documentElement.scrollHeight").toString());
int scrollInitial = 0;
int scrollFinal = heightInner - 150;
((JavascriptExecutor) getDriver())
.executeScript("window.scrollBy(0,-" + Integer.toString(heightTotal) + ")");
for (int i = 0; i < (heightTotal / scrollFinal); i++) {
Serenity.takeScreenshot();
((JavascriptExecutor) getDriver()).executeScript(
"window.scrollBy(" + Integer.toString(scrollInitial) + "," + Integer.toString(scrollFinal) + ")");
}
} catch (Exception e) {
logger.info(e.getMessage());
}
}
Tuesday, 24 March 2020
How to create customized test execution report in selenium
In this play list I have explained how we can create customized test execution report in selenium.
Download Framework
Save Water | Save Energy | Save Earth
Stop Pollution | Stop Plastic
Spread Peace
Subscribe to:
Posts (Atom)