USA +1-347-270-8720 | INDIA +91-9642190360 training@absofttrainings.com

Use SOLID Principles To Become Better Automation Tester

Are you using most recommended and fundamental SOLID principles in your automation? Why You Need To Use SOLID Principles? Like any development work, automation also needs to be planned, designed, developed, maintained and extended over time. Your automation code or automation framework is an application which is testing your actual application. That’s why SOLID principles are highly recommend for your automation to make it easy to understand, use, maintain and extend over time. When SOLID principles are not applied, your automation might become fragile, hard to maintain and hard to extend very soon. This is the first post in a series of posts that describe & apply the SOLID principles of object-oriented design and programming to web automation using Selenium & Java. Even if you are using different programming language like C#, Python or automation tool like HP UFT/QTP for automation, you should definitely consider applying SOLID principles to make your automation tester life easy. Please note that we will be discussing about applying SOLID principles to web automation using Selenium & Java. But, once you learn the concepts, you can easily apply them to any object-oriented development. In this post, we will be exploring what SOLID principles stands for. We will be having one post for each principle with real life examples from web automation using Selenium & Java. What Are The SOLID Principles? SOLID principles are the first five object-oriented design principles by Robert C. Martin, popularly known as Uncle Bob. SOLID is an acronym where:- S stands for Single Responsibility Principle (SRP) O stands for Open Closed Principle (OCP) L stands for Liskov Substitution Principle (LSP) I stands for Interface Segregation...

Selenium Tutorial – Selenium Hybrid Automation Framework

In this tutorial, we are going to cover following: Introduction to Framework Hybrid Framework Structure How to make Hybrid Framework Easy to use for all Easy to understand Easy to maintain How to specify test config outside the project Page Objects Framework Writing Login Test with Page Objects Framework Data Driven Framework How to Organise Test Data in Excel File Applying Data Driven Framework to Login Test Running Tests with TestNG and...

Real World Selenium Resume which gets more Job Interviews

Is your Selenium resume getting enough interviews for you? Is there no chance of further improvements to your Selenium resume? If your answer is no to these questions, you are at right place. We are happy to start our blog and write first post on resume so that you can take your resume to next level and get more interviews. We are 100% sure you agree that no matter what job you want to get or how good your experience is – your resume will be, without doubt, the most important part of getting the job you want. Resume is your starting point for the job you want. Your resume should be amazing and excellent that it gets you interviews and then your dream job. Getting the job in today’s market is extremely competitive than you think. Recruiters or employers are receiving hundreds of resumes for every open position and they want to interview only very few best candidates like top 5 to 10 candidates per position. Don’t you want to become one of those? Then, it’s your resume that makes it possible. A bad resume (with issues like no relevant keywords, unrelated experience, badly formatted, big employment gaps and too many different jobs) makes very hard to get the interviews and the job you want. In this post, we will discuss what you should put in your resume and how, what you shouldn’t put in your resume to make it amazing and excellent. Please note that these are our thoughts/views which our instructors experienced over the years in the industry. This is what worked out really great for our...

How to Use New FirefoxDriver – GeckoDriver or Marionette With Selenium 3?

From Firefox version 47 & Selenium version 2.53.0 combination and above, FirefoxDriver() will not work to drive the Firefox browser. You need to use new driver for Firefox called Marionette. Marionette is an automation driver for Mozilla’s Gecko engine. It can remotely control either the UI or the internal JavaScript of Gecko platform which is core engine of Firefox. Steps to Use New FirefoxDriver – GeckoDriver or Marionette Install or update to latest version of Firefox Download latest Selenium client bindings for your language or Selenium Server jar from http://docs.seleniumhq.org/download/ and add to your project Download latest geckodriver from https://github.com/mozilla/geckodriver/releases For the below example Java code, I have used following versions: Firefox 51.0.1, geckodriver  0.14.0 and Selenium Java client binding 3.0.1. Now, instead of just saying WebDriver driver = new FirefoxDriver(); to initialize your driver for Firefox browser, you need to change the code as below: // Change as per your geckodriver download location System.setProperty(“webdriver.gecko.driver”,”G:/SeleniumTraining/Selenium/TrainingFiles/Software/geckodriver-v0.14.0-win64/geckodriver.exe”); // Create Firefox Driver with Marionette capabilities DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability(“marionette”, true); WebDriver driver = new FirefoxDriver(capabilities); After above code, you should be able to use driver variable as usual. Please do the above steps and copy below example Java code in Eclipse. Now run the code and see how it’s working. package testpackage; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.remote.DesiredCapabilities; public class IndeedJobSearch { public static void main(String[] args) throws InterruptedException { // Change as per your geckodriver download location System.setProperty(“webdriver.gecko.driver”,”G:/SeleniumTraining/Selenium/TrainingFiles/Software/geckodriver-v0.14.0-win64/geckodriver.exe”); // Create Firefox Driver with Marionette capabilities DesiredCapabilities capabilities = DesiredCapabilities.firefox(); capabilities.setCapability(“marionette”, true); WebDriver driver = new FirefoxDriver(capabilities); // Set implicit wait for 30 seconds driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); // Perform job search in Indeed website driver.get(“http://www.indeed.co.in/”); driver.findElement(By.id(“what”)).sendKeys(“Selenium”);...

How to get a number (int or double) in a string message?

JAVA Code public class ExtractIntAndDouble { public static void main(String[] args) { //*************** Extracting int values ************************* String searchCountStr = “There are 280 search results”; // or String cartCountStr = “There are total 6 items in your cart”; int searchCount = Integer.parseInt(searchCountStr.replaceAll(“\\D”, “”)); System.out.println(searchCount); //*************** Extracting double values ************************* String totalPriceStr = “Your have paid £154.75 for this order”; // or String totalPriceStr = “Total Price: £154.75”; double totalPrice = Double.parseDouble(totalPriceStr.replaceAll(“[^0-9\\.]+”, “”)); System.out.println(totalPrice); } } In searchCountStr.replaceAll(“\\D”, “”), “\\D” is a regular expression to represent all non-digit characters and “” represents blank string. searchCountStr.replaceAll(“\\D”, “”) gives string with only digits like “280” by replacing all non-digit characters with blank string. In totalPriceStr.replaceAll(“[^0-9\\.]+”, “”), “[^0-9\\.]+” is a regular expression to represent all characters except digits 0-9 and dot character (.). Also, “” represents blank string. totalPriceStr.replaceAll(“[^0-9\\.]+”, “”) gives string with only double value like “154.75” by replacing all characters with blank string except digits 0-9 and dot character (.) . This is more effective than using split function (mentioned below) as we don’t need to worry about our int or double value position and  currency symbols before price values String[] tempArray = searchCountStr.split(” “); int searchCount = Integer.parseInt(tempArray[2]); System.out.println(searchCount); The above code will work for string “There are 280 search results” but will not work for string “There are total 6 items in your cart”. This is because int value position changes in both...
Subscribe to get top free videos, hot offers and latest news!

Subscribe to get top free videos, hot offers and latest news!

You have successfully subscribed to get your Free Videos & Hot Offers.


Copyright © 2016 ABSoft Trainings. All rights are reserved.
Registered in England & Wales under Company No: 09166392
Back To Top | Terms of Use | Privacy Policy | Refund & Cancellation Policy | Site Map