Wednesday, May 18, 2022
Selenium Java - Shadow DOM, TestNG, Properties File, Extent Reports, Screenshot
Wednesday, May 4, 2022
Types of Test Automation Framework
Framework:
A testing framework is a set of rules used for creating and designing test cases.
Different types of frameworks:
1. Linear Scripting Framework:
- Linear Scripting Framework is a basic level test automation framework that is in the form of ‘Record and Playback’ in a linear fashion.
- This framework is also known as the ‘Record and Playback’ framework.
- This type of framework is used to test small-sized applications.
2. Modular Testing Framework:
- In the modular testing framework, testers create test scripts module-wise by breaking down the complete application under test into smaller, independent tests.
- In simple words, testers divide the application into multiple modules and create test scripts individually.
3. Data-driven Framework:
- The data-driven test automation framework is focused on separating the test script logic and the test data from each other.
- It allows us to create test automation scripts by passing different sets of test data.
- The test data set is kept in external files or resources such as MS Excel Sheets, MS Access Tables, SQL Database, XML files, etc.,
4. Behavior-Driven Development Testing Framework:
- The purpose of this Behavior Driven Development framework is to create a platform that allows everyone (such as Business Analysts, Developers, Testers, etc,) to participate actively.
- It requires increased collaboration between Development and Test Teams.
- It doesn’t require the users to be acquainted with a programming language. We use non-technical, natural language to create test specifications.
Friday, April 29, 2022
Essential Strategies for Learning Basics of Software Testing
What is Software?
Software is a collection of code installed onto your computer's hard drive.
Types of software:
- System software
- Application software
- Testing the software whether it is working according to the requirement.
- Expected Result = Actual Result(Test Pass)
- Expected Result != Actual Result(Test Fail)
- Manual Testing
- Automation Testing
Friday, April 22, 2022
Selenium WebDriver Browser Commands Explained: Best Practices and Examples
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Selenium_Webdriver {
public static void main(String[] args) {
String driverExecutablePath = "C:\\Selenium\\chromedriver\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", driverExecutablePath);
// Create a new instance of the Chrome driver
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().window().maximize();
// Storing the Application Url in the String variable
String url = "https://suriyaparithy.blogspot.com/";
//Launch the ToolsQA WebSite
driver.get(url);
// Storing Title name in the String variable
String title = driver.getTitle();
// Storing Title length in the Int variable
int titleLength = driver.getTitle().length();
// Printing Title & Title length in the Console window
System.out.println("Title of the page is : " + title);
System.out.println("Length of the title is : "+ titleLength);
// Storing URL in String variable
String actualUrl = driver.getCurrentUrl();
if (actualUrl.equals(url)){
System.out.println("Verification Successful - The correct Url is opened.");
}
else {
System.out.println("Verification Failed - An incorrect Url is opened.");
//In case of Fail, you like to print the actual and expected URL for the record purpose
System.out.println("Actual URL is : " + actualUrl);
System.out.println("Expected URL is : " + url);
}
// Storing Page Source in String variable
String pageSource = driver.getPageSource();
// Storing Page Source length in Int variable
int pageSourceLength = pageSource.length();
// Printing length of the Page Source on the console
System.out.println("Total length of the Pgae Source is : " + pageSourceLength);
}
}
From Beginner to Expert: Java Loop Programming
Loops :
- Loops are used to execute a set of statements repeatedly until a particular condition is satisfied.
Types of Loops :
for loop: This executes a statement a particular number of times.
while loop: This executes a statement an unknown number of times.
do-while loop: This executes a statement at least one time.
The syntax for the "for" loop is :
for(Variable Initialization; Boolean_Expression Test; Increment/Decrement){
//Statements
}
Example :
package selenium;
public class Java_practise {
public static void main(String[] args) {
// This will print -- 0,1,2,3,4,5
for(int Increment = 0;Increment<=5;Increment++){
System.out.println("Count is ==> " + Increment );
}
// This will print -- 5,4,3,2,1,0
for(int Decrement = 5;Decrement>=0;Decrement--){
System.out.println("Count is ==> " + Decrement );
}
// This will print -- 0,2,4
for(int Increment = 0;Increment<=5;Increment+=2){
System.out.println("Skip every one another ==> " + Increment );
}
// This will print -- 0,1,2,3,4,5
for(int Count = 0;Count<=10;Count++)
{
if(Count==6){
break;
}
System.out.println("Count is ==> " + Count );
}
// This will just print -- 3
for(int Count = 0;Count<=5;Count++){
if(Count==3){
System.out.println("Count is ==> " + Count);
continue;
}
}
}
}