Posts

Test-aliens are here on Earth, Go slow developers!

Image
 Why should a company have a team for Software Testing and Quality Assurance? What is the need to test a software? Why shouldn't developers test their own work? When I started my career around two years back I encountered above listed queries. At that time I had no reply to these queries. But after dwelling around two years in IT sector I come along with some firm replies. All above listed questions are inter-belonging and the highlighted one was recently posted in a programmer's Q&A post, it inevitably raised my curious eyebrow. This can be a big debate. Diving straight to the point, the simple, unmistakable and well known answer is : “Developers are not very good testers.” But according to my understanding correct answer is, - “They don't want to see bugs in their code and only look for happy paths and and happy endings.” Believe me I was a developer in the past and then I moved to QA to avoid QA on my code, now I'm coding Automated Selenium Scrip

Handle Multiple Browser Tabs and Alerts with Selenium WebDriver

Image
In this tutorial, we will learn to handle multiple browser tabs within a single Selenium script. Selenium WebDriver does not provide any commands for this task.  But we can make use of the existing Selenium commands in a smarter way to automate this scenario. Although this scenario is quite rare and you will not encounter it usually. 1. Handle Multiple Browser Tabs with Selenium Use Selenium Actions Class to Handle Multiple Browser Tabs Actions Class in Selenium is a special class which provides us very useful commands, which helps us to replicate Keyboard and Mouse events i.e., press/release any Key, move cursor, drag and drop, right click, double click etc. You can learn about Actions Class in detail here .  In our scenario, we'll make use of Key control commands of Actions class to automate open and automate multiple browsers. Let's understand the whole code logic step by step. 1.1. Launch google.com with Selenium WebDriver This is the most common part, we'll launc

Java Loops and Control Statements

Image
In programming if you want to repeat the execution of particular set of instructions or want to execute a function/set of lines repeatedly then we use loops. For example you want to print a number 10 times, what would you do? Probably a newbie would write print statement 10 times, but we can do the same thing to use a loop.  Let's understand the different types of loops with examples. For loop For-each loop While loop Do-While loop 1. For Loop When you know that you want to execute your code fixed no. of times say 10 times, then for loop comes into picture. It's the mostly used and the simplest loop in any programming. Here is the For loop structure: for (initializing variable; condition; increment/decrement) { // Code/Statement to be iterated } It has four different elements, let's understand them: Initialization Variable - It is the starting point of the for loop. This variable gets initialized when for loop gets started. Condition - It comes into play after initia

Java Conditional Statements

Image
  Java , like all other programming languages, is equipped with specific statements that allow us to check a  condition  and execute certain parts of code depending on whether the  condition  is true or false. Such statements are called conditional, and are a form of composite statement. The Java  if statement  is used to test the condition. It checks boolean condition:  true  or  false . There are various types of if statement in Java. if statement if-else statement if-else-if ladder nested if statement Java supports the usual logical conditions from mathematics: Less than:  a < b Less than or equal to:  a <= b Greater than:  a > b Greater than or equal to:  a >= b Equal to  a == b Not Equal to:  a != b Java if Statement The Java if statement tests the condition. It executes the  if block  if condition is true. Syntax: 1.    if (condition){   2.    //code to be executed    3.    }   Example: 1.    //Java Program to demonstrate t