Software testing: 6 common mistakes that are costing you a fortune

Software testing: 6 common mistakes that are costing you a fortune –

Software testing is a process that involves the execution of a program or application to discover bugs and verify that the software is suitable to be released and used.

Software testing common mistakes - 6 mistakes that are costing you a fortune

The testing stage also provides crucial information to companies regarding the quality of the software, whether it meets the requirements outlined in the design phase along with the risk associated with implementing the software.

It is an iterative process that requires meticulous strategizing to select the appropriate tests, from an infinite number of possible tests, which are most feasible to conduct according to the available time and resources.

Due to the sensitivity of the testing procedure and the critical information provided by it, even the simplest of mistakes can result in software failure or compromised user experience, causing massive financial losses to the organization that released the software. Following are the most common mistakes made by testers that can be overcome to save reputations and investments.

Failing to communicate (Common mistakes 1)

Communication is an integral part of a software tester’s job description. You have to conduct meetings with system users and product owners to understand the scope of the project and its requirements.

You have to communicate with the developers to outline the discovered defects and errors. You have to collaborate with your team to brainstorm possible test automation systems that need to be executed. Finally, you have to report your progress to the test managers.

If you fail to conduct effective communication with your colleagues, you will not be able to exchange feedback, understand the inherent testing requirements and, deliver to the best of your abilities.

Therefore, apart from being a competent tester, you need to foster two-way communication with all parties involved in the SDLC to avoid problems and deliver a high-quality software.

Missing the testing goal (Common mistakes 2)

Before you begin testing a new feature, you need to understand what you are required to do explicitly and the route you need to take during the planning and testing phase.

To achieve this, you should be forthcoming and always ask relevant questions to your manager or the representative of the developing team to dispel any confusions that you might have about the task at hand. Asking queries and seeking advice helps you learn and grow as a tester. Moreover, if you fail to acknowledge your lack of understanding about the testing procedure that needs to be implemented, you can overlook the bugs in the software, causing irreparable damage to the reputation and financial state of the software vendor.

Oversteping the job description (Common mistakes 3)

Software testing requires thorough scrutiny of the application, feature or product that is being tested to ensure a flawless program that fulfils the developers’ expectations and the customers’ requirement. As a tester, you have your work cut out for you. Therefore, it is recommended to focus all your attention on detecting errors and defects that can be reported to the developer.

Even though it is not uncommon for testers to fix some trivial bugs that repeatedly resurface, the main reason for exercising restraint is that you might fix the apparent bug, but it might cause some regression bugs in another part of the code. In addition, if you fix the bug yourself and do not report it, the developer will not get any feedback about the mistake they made, causing them to repeat the error.

Failing to innovate (Common mistakes 4)

Software testing has seen unprecedented evolution since its inception. From testing with waterfall model to agile testing to integrated quality assurance, the processes have seen continuous improvement. To remain relevant as a tester in this ever-changing technological realm, you need to adapt to the advances and learn the latest testing methods.

New test methods are designed to facilitate testers and expedite their work processes. If you fail to evolve as a software tester, you will not only become a liability to your organization, but also slow down the testing procedure and delay software delivery and release.

Being limited to defined test cases (Common mistakes 5)

Before beginning the testing process, the testing team outlines the test case which includes a fixed set of variables to determine the state of the software under test.

Occasionally, the tester is so busy following the checklist so precisely that they fail to notice the apparent bugs.

While the test case is a highly significant component of testing; as a competent software tester, you need to remain vigilant during the test execution as it can help you discover anomalies in other parts of the software that were not included in a particular test case.

This practice can save you from causing an inadvertent yet catastrophic system failure.

Failure to report an issue to the developers (Common mistakes 6)

Once you have worked as a software tester for a few years and gained some solid work experience, you can intuitively find bugs in the system. Sometimes, the bugs may not be apparent but you may observe a problem in the system, or you may be unsure whether the issue is a bug or malpractice on your part.

In such situations, you should always trust your instincts and report the issue to the developers before it becomes a genuine defect in the product being tested.

The designing stage thrives on continuous feedback so even if the reported issue was not a bug, the developers can gain valuable insights into the software design. Also if the problem was from your end due to misconfigurations of settings, misunderstanding of the test case features, etc.; the developers can notify you of your errors which can help you reevaluate your test case or metrics to deliver high performing software.

To remain abreast with the complex, modern-day software testing methodologies, it is intrinsic for you as a software tester to establish effective communication channels and to evolve with the ongoing innovations in the field of software testing.

AUTHOR BIO

Alycia Gordan
Alycia Gordan is a freelance writer who loves to read and write articles on Alycia Gordan - Guest Writter at www.automationTalks.com
healthcare technology, fitness and lifestyle. She is a tech junkie and divides
her time between travel and writing.

You can find her on Twitter: @meetalycia

 

Are you interested for writing guest article for this blog? – Contact here

For Automation Testing Tutorials –> AutomationTalks.com

 

 

Selenium Interview Question and Answers – Part 1

On this page, you can find Basic Selenium Interview questions and answers which may benefit to freshers to experienced professional. This is part 1 of this interview questions series.

Very Basic Interview Questions –

1  What types of Testing are supported by selenium?

Functional Testing and regression testing

2. When should we go for selenium Grid?

Selenium Grid is used for test execution and not for test case design. It is used to execute test cases on same or different platforms on multiple machines parallel.

3. What is latest version of Selenium?

Selenium 3

4. What is difference between single slash (/) and double slash(//)?

/ – denotes that it is absolute Xpath ,that is starting from root node of the webpage
//- denotes it is relative Xpath, meaning, can starts from anywhere in the page.

5. What are different types of locators in selenium webdriver?

Id, class, Xpath, CSS, Name, Tagname, linkText, partial LinkText etc.

6. What is difference between assert and verify?

Assert – Test case terminated once assert fails.
verify – Test case is not terminated even if verify fails.

7. What are different types of drivers available in selenium WebDriver?

Firefox Driver, IEDriver, Chrome Driver, Safari Driver, HtmlUnitDriver etc.

 

 

Refer Part 2 onwards for advanced Interview Questions.

Selenium Interview Question and Answers – Part 3

In this Article, you can find Selenium Interview question and answers – Part 2. This is in continuation of Part2.

Selenium Interview Questions and Answers

11. How to handle alerts and confirmation boxes in Selenium WebDriver?.

Selenium provides an API to handle this. Alert alert().
Below are the methods present in Alert API, which are used to handle Alerts
void accept(): This is equivalent to the OK button action on the dialog. The corresponding OK button actions are invoked when the accept() action is taken on a dialog.
void dismiss():This is equivalent to clicking on the CANCEL action button.
java.lang.S tring getText(): This will return the text that appears on the dialog. This can be used if you want to evaluate the text on the modal dialog.
void sendKeys(java.lang.S tring keysToSend): This will allow the developer to type in some text into the alert if the alert has some provision for it.

12. How to handle colours in Selenium Webdriver ?

Get the value of a given CSS property. Color values should be returned as rgba strings, so, for example if the “background-color” property is set as “green” in the HTML source, the returned value will be “rgba(0, 255, 0, 1)”.

13. How to press shift +tab in Selenium?

public class SendKeys
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchBox = driver.findElement(By.name("q")); searchBox.sendKeys(Keys.chord(Keys.SHIFT, "packt publishing")); }
}

14. How to take a screenshot in selenium?

WebDriver driver = new FirefoxDriver(); driver.get("http://www.google.com/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy somewhere 

FileUtils.copyFile(scrFile, new File("c:\\tmp\\screenshot.png"));

15. Is there a way to click hidden link in Selenium WebDriver?

There is a easier way to work around the problem using JavascriptExecutor.
For example:

document.getElementsByClassName('post-tag')[0].click();

The above javascript would click on the “Selenium” tag on the top right of this page (next to your question), even if it were hidden.
All you need to do is issue this JS instruction via the JavascriptExecutor interface like so:

(JavascriptExecutor(webdriver)).executeScript("document.getElementsByClassName('post-tag')[0].click();");

16. What are the technical challenges that you faced with selenium?

Answer to this question differ person to person. Do tell all the challenges in real which you faced.

17. What is an Xpath in Selenium?

Xpath is used to locate a web element based on its XML path. XML stands for Extensible Markup Language and is used to store, organize and transport arbitrary data. It stores data in a key-value pair which is very much similar to HTML tags. Both being markup languages and since they fall under the same umbrella, Xpath can be used to locate HTML elements.

18. How to refresh a page without using context click?

1.Using sendKeys.Keys method

driver.get("https://accounts.google.com/SignUp");
driver.findElement(By.id("firstname-placeholder")).sendKeys(Keys.F5);

2.Using navigate.refresh() method

driver.get("url");
driver.navigate().refresh();

3.Using navigate.to() method

driver.get("url");
driver.navigate().to(driver.getCurrentUrl());

4.Using get() method

driver.get("url");
driver.get(driver.getCurrentUrl());

5.Using sendKeys() method

driver.get("https://accounts.google.com/SignUp");
driver.findElement(By.id("firstname-placeholder")).sendKeys("\uE035");

19. How to handle autocomplete box in web driver?

driver.findElement(By.id("your searchBox")).sendKeys("your partial keyword"); 
Thread.sleep(3000);
List <WebElement> listItems = driver.findElements(By.xpath("your list item locator")); listItems.get(0).click();
driver.findElement(By.id("your searchButton")).click();

20. Difference between the getWindowHandle and getWindowHandles.

getWindowHandles() –  Syntax: Set getWindowHandles()
Example: driver.getWindowHandles();
Purpose: Return a set of window handles which can be used to iterate over all the open windows of this Webdriver instance  by passing them to switchTo().WebDriver.Options.window() Returns: A set of window handles which can be used to iterate over all the open windows.

getWindowHandle() – Syntax: String getWindowHandle()
Example: driver.getWindowHandle();
Parameter: Return an opaque handle to this window that uniquely identifies it within this driver instance. This can be used to switch to this window at a later date.

 

Refer below posts for next interview questions –

Selenium Interview Questions and Answers – Part 1

Selenium Interview Question and Answers – Part 3

Selenium Interview Question and Answers – Part 4

Selenium Interview Question and Answers – Part 5

Selenium Interview Questions and Answers – Part 2

On this page, you can find Selenium Interview questions and answers which may benefit to freshers to experienced professional. This is part 2 of this interview questions series.

1. How to Handle windows authentication popup using any third party tool .

Below are the steps to achieve this Using Autoit (Third Party Tool) –
Download and in Autoit editor write script through below command
ControlFocus(), ControlSet(), ControlClick()
Save file and Compile Script with your version and after that you get .exe file.
Java code for executing .exe file
Runtime.getRuntime().exec(\\Path)
It throws checked exception IOexception.

2. What are the different types of Exceptions in Selenium Webdriver?

Refer this post for detailed answer

3. What is StaleElementException?

StaleElementException occurs if I find an element, the DOM gets updated then I try to interact with the element.

4. Can we enter text without using sendKeys()?

Yes by using JavascriptExecutor

WebDriver driver = new FirefoxDriver();
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("document.getElementById("textbox_id").value='new value';);

5. How to find more than one web element in the list?

At times, we may come across elements of same type like multiple hyperlinks, images etc arranged in an ordered or unordered list. Thus, it makes absolute sense to deal with such elements by a single piece of code and this can be done using WebElement List.
Sample Code:

// Storing the list
List <WebElement> elementList = driver.findElements(By.xpath("//div[@id='example']//ul//li"));

// Fetching the size of the list 
int listSize = elementList.size(); 
for (int i=0; i<listSize; i++)
{
// Clicking on each service provider link 

serviceProviderLinks.get(i).click();

// Navigating back to the previous page that stores link to service providers 
driver.navigate().back();
}

6. What is the difference between driver.close() and driver.quit command?

close(): WebDriver’s close() method closes the web browser window that the user is currently working on or we can also say the window that is being currently accessed by the WebDriver. The command neither requires any parameter nor does is return any value.
quit(): Unlike close() method, quit() method closes down all the windows that the program has opened.
Same as close() method, the command neither requires any parameter nor does is return any value.

7. Difference between findElement/findElements ?

findElement () will return only single WebElement and if that element is not located or we use some wrong selector then it will throw NoSuchElement exception.
findElements() will return List of WebElements – for this we need to give locator in such a way that it can find multiple elements and will return you list of webelements then using List we can iterate and perform our operation.

import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class findElementDemo {
public static void main(String[] args) throws Exception {
WebDriver driver=new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http://google.com");
Thread.sleep(5000);
List<WebElement> links=driver.findElements(By.xpath(".//*[@id='menu-top']/li")); System.out.println("Total element is "+links.size());
Iterator<WebElement> i1=links.iterator();
while(i1.hasNext)
WebElement ele1=i1.next();
String name=ele1.getText();
System.out.println("Elements name is "+name);
}
}
}

8. Difference between assert and verify in selenium Webdriver

When an “assert” fails, the test will be aborted. Assert is best used when the check value has to pass for the test to be able to continue to run log in.
Where if a “verify” fails, the test will continue executing and logging the failure.Verify is best used to check non critical things. Like the presence of a headline element.

9. How will you execute your login script using chrome browser from your editor using selenium?

System.setProperty("webdriver.chrome.driver","C:\\Users\\Public\\Documents\\Selenium\\chromedriver.exe"); 
WebDriver driver = new ChromeDriver();

10. Can we use multiple catch in try, how ?

Yes, we can use. Refer below Example –

public static void main(String args[]){ try{
int a[]=new int[5];
a[5]=30/0;
}
catch(Exception e)
{
System.out.println("common task completed");
}
 catch(ArithmeticException e) 
{
System.out.println("task1 is completed");
}
 catch(ArrayIndexOutOfBoundsException e)
 {
System.out.println("task 2 completed");
}
 System.out.println("rest of the code...");
}
}

Refer below posts for next interview questions –

Selenium Interview Questions and Answers – Part 2

Selenium Interview Question and Answers – Part 3

Selenium Interview Question and Answers – Part 4

Selenium Interview Question and Answers – Part 5

Different Types of Exceptions in Selenium WebDriver

During automation in Selenium WebDriver, we come across various exceptions & we need to deal with them. Below is the list of various exceptions occur in selenium webdriver.
In general, hierarchy of Exceptions in any language is shown in below image –
Exceptions in Selenium WebDriver

There are main three types of Exceptions in Selenium WebDriver –

  1. Checked Exceptions – These Exceptions can be handled during compile time. If they are not handled, it gives compile time error. Example- FileNotFoundException, IOException etc.
  2. Unchecked Exceptions – These exceptions can not be handled during compile time & they got caught at run time. Example – ArrayIndexOutOfBoundException.
  3. Error – Errors which can not be handled by using even try catch block. Example -Assertion Error.

Below are few common exceptions received during selenium scripting in java – selenium.

WebDriverException

WebDriver Exception comes when we try to perform any action on the non-existing driver.

WebDriver driver = new InternetExplorerDriver();
driver.get("http://google.com");
driver.close();
driver.quit();

NoAlertPresentException

When we try to perform an action i.e., either accept() or dismiss() which is not required at a required place; gives us this exception.

try{
driver.switchTo().alert().accept();
}
catch (NoAlertPresentException E){
E.printStackTrace();
}

NoSuchWindowException

When we try to switch to an window which is not present gives us this exception:

WebDriver driver = new InternetExplorerDriver();
driver.get("http://google.com");
driver.switchTo().window("Yup_Fail");
driver.close();

In the above snippet, line 3 throws us an exception, as we are trying to switch to an window that is not present.

NoSuchFrameException

Similar to Window exception, Frame exception mainly comes during switching between the frames.

WebDriver driver = new InternetExplorerDriver();
driver.get("http://google.com");
driver.switchTo().frame("F_fail");
driver.close();

In the above snippet, line 3 throws us an exception, as we are trying to switch to an frame that is not present.

NoSuchElementException

This exception is thrown when we WebDriver doesn’t find the web-element in the DOM.

WebDriver driver = new InternetExplorerDriver();
driver.get("http://google.com");
driver.findElement(By.name("fake")).click();

TimeoutException

Thrown when a command does not complete in enough time.

StaleElementException

StaleElementException occurs if I find an element, the DOM gets updated then I try to interact with the element.

If Javascript updates the page between the findElement call and the click call then I’ll get a StaleElementException. It is not uncommon for this to occur on modern web pages. It will not happen consistently however. The timing has to be just right for this bug to occur.

So how do I handle it? I use the following click method:

public boolean retryingFindClick(By by) { boolean result = false;
int attempts = 0;
while(attempts < 2) {
try {
driver.findElement(by).click();
result = true;
break;
} catch(StaleElementException e) {
}
attempts++;
}
return result;
}

So, these the common exceptions which occur during automation which i tried to cover. Hope this helps !!!!

Use of Map (Hashmap) with TestNG Dataprovider in Data Driven Testing.

In this article, i will talk about how to use Map (Hashmap) with TestNG DataProvider for Data Driven Testing in Selenium WebDriver. Before to this, let us understand little more about Map.

What is Map in Java?
—> Map is a interface in java and can implements various classes in java like Hashmap, Hashtable & many other. They are the part of collections framework and are used to handle. store data. Map interface represent the mapping in between key and value. What that mean it, in Map or hashmap, value is stored in the form of Key & Value pair. In this article i will try to demonstrate the same.

Map in testng dataprovider selenium webdriver

Syntax to define map –>  Map mapA = new HashMap();

How to add value in map?   –> mapA.put(“key1”, “element 1”);

How to get value from map?  –>  Object value = mapA.get(key);
–> Value from map can also be retrived by using Iterator. Shown in above screenshot.

Now, how to use Map to with TestNG Dataprovider in Data Driven Testing?

Let us suppose my Test data file is located at: C://Users//Prakash//Desktop//TestData.xlsx & it looks as shown in below image –

Test data for Data Driven Testing with Map and TestNG DataProvider

Now, our task is to pass value from row 2 onward to our test case using Map. Have a look on below Selenium Java code –

package demoPackage1;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class Testclass {

  @Test(dataProvider = "data")
  public void integrationTest(Map<Object, Object> map) {
    System.out.println("-------------Test case started ----------------");
    System.out.println(map.get("UserName"));
    System.out.println(map.get("Password"));
    System.out.println(map.get("DoB"));

    System.out.println("-------------Test case Ended ----------------");

  }

  @DataProvider(name = "data")
  public Object[][] dataSupplier() throws IOException {

    File file = new File("C://Users//Prakash//Desktop//TestData.xlsx");
    FileInputStream fis = new FileInputStream(file);

    XSSFWorkbook wb = new XSSFWorkbook(fis);
    XSSFSheet sheet = wb.getSheetAt(0);
    wb.close();
    int lastRowNum = sheet.getLastRowNum() ;
    int lastCellNum = sheet.getRow(0).getLastCellNum();
    Object[][] obj = new Object[lastRowNum][1];

    for (int i = 0; i < lastRowNum; i++) {
      Map<Object, Object> datamap = new HashMap<>();
      for (int j = 0; j < lastCellNum; j++) {
        datamap.put(sheet.getRow(0).getCell(j).toString(), sheet.getRow(i+1).getCell(j).toString());
      }
      obj[i][0] = datamap;

    }
    return  obj;
  }

}

Once you run above test case, Console output will looks like –

[TestNG] Running:
  C:\Users\Prakash\AppData\Local\Temp\testng-eclipse-1161438956\testng-customsuite.xml

-------------Test case started ----------------
user1
pass1
dob1
-------------Test case Ended ----------------
-------------Test case started ----------------
user2
pass2
dob2
-------------Test case Ended ----------------
-------------Test case started ----------------
user3
pass3
dob3
-------------Test case Ended ----------------
PASSED: integrationTest({UserName=user1, DoB=dob1, Password=pass1})
PASSED: integrationTest({UserName=user2, DoB=dob2, Password=pass2})
PASSED: integrationTest({UserName=user3, DoB=dob3, Password=pass3})

===============================================
    Default test
    Tests run: 3, Failures: 0, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 3, Failures: 0, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@7c30a502: 47 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@7e0ea639: 15 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@3ac3fd8b: 47 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@71be98f5: 16 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@511baa65: 15 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 0 ms

In Above Console O/P you can clearly see that, test case has been run 3 times with 3 set of test data & is taken from Excel sheet using testNG DataProvider.

 

Refer below video to understand more about How to use map and hashmap along with testng dataprovider –

Hope above example helps !!!

 

For more about Test Automation Framework, refer below links –

Automation Frameworks –

1. Why Automation Framework in selenium?
2. Types of Test Automation Framework in Selenium
         a. Page Object Model (POM)
         b. Data Driven Test Automation Framework
         c. Keyword Driven Test Automation Framework
         d. Hybrid Test Automation Framework
         e. Behavior Driven Development Framework

 

Mainframe Testing

On this page you will learn about mainframe testing. So basically is a testing performed on mainframe application (Mainframe computer).
Now what is mainframe? It is a large size computer which is made up with frames & all frames put together are called as mainframe. Various mainframes available in market are – IBM, HP, HoneyWell, UNISYS etc .  .  . Out of these, major one is IBM, they produce very large volume of mainframe computers.
Mainframe is a business operating system, It can store a huge volume of data. Data can be processed at very high speed.
The biggest use of mainframe is in banking and insurance systems. However many other systems do use mainframe computers. Now comming to mainframe testing –

What is Mainframe Testing?

Testing mainframe based application is nothing but mainframe testing. Process wise it is not different than other types of testing but the difference is of technology. Mainframe testing covers batch testing and online testing. Comparing Manual testing with testing mainframe, Process wise it is not different than other types of testing but the difference is of technology. In other manual testing we do testing on let us say web application or any desktop application having GUI. But in case of mainframe application, there is no GUI, all you can see is blue screens that can be a mainframe host for batch testing or it can be CICS Screens for online testing.

Below image shows overview of mainframe testing. Basic concept is same in online testing mode. But in case of batch testing, we need to setup data (could be files or could be via CICS screens) & then run JCL. Once job processing is successful, Need to verify output files / tables / CICS Screens for results. This all depends on case to case, application to application.

Mianframe testing overview
I tried to cover some interview questions which are commonly asked in mainframe testing interview questions. Have a look on below links.

Mainframe testing interview questions – part1

Mainfrme testing interview questions – part2

Mainfrme testing interview questions – part3

Mainfrme testing interview questions – part4

 

Hope this helps !!!!

Mainframe Testing Interview Questions – Part 3

In this post you will find mainframe testing interview questions and answers (part3), most commonly asked interview questions for mainframe.

1  What is FileAID?
–> FileAID is a mainframe tool, accessed by command line that gives the user ability to browse or edit sequential and VSAM files or DB2 database data. It is used to create or change the file contents. You need to provide input file name (which you want to edit / create), then copybook name (layout of the required file).

2. What are the modes browsing in File-AID?
–> (F) Formated Mode (It requires layout in which file should open)
–> (V) Vertical formated Mode (It requires layout in which file should open)
–> (U) Unformated mode (It does not requires layout in which file should open)
–> (C) Charactor Mode   (It does not requires layout in which file should open)

3. What is InSYNC?

 

4. Why do we need File Management Tools?
–> View a file with computational variables
–> View VSAM File
–> Perform all operations on dataset
–> Define VSAM File, Create GDG
–> Compare 2 files
–> Convert file from one layout in to other

5. Difference between IMS Database and DB2 databse?

 

6.