Virtusa Automation Testing Interview Questions

In this I am explaining my interview experience with Virtusa with Selenium C# and Appium. I am providing the Interview Questions and Answers below for Technical Round.

Watch YouTube Video here Virtusa interview questions for automation testing 

Question1: Can you introduce about yourself?

Answer:

Provided details about testing experience and about the roles and responsibilities I had in previous companies.

Question2: Can you explain about framework you have used with appium.

Answer:

I have experience working with a BDD framework integrated with the Page Object Model (POM) in my previous project. The framework was designed to support both Android and iOS mobile automation by handling platform-specific elements separately while maintaining reusable and maintainable code.

As part of the framework implementation, we followed a layered structure consisting of Feature Files, Step Definitions, and Script Files. The Feature Files were written using Gherkin syntax to define business scenarios in a readable format for both technical and non-technical stakeholders.

The Step Definition layer acted as a bridge between the Feature Files and the automation code. Each step written in the Feature File was mapped to corresponding Step Definition methods, which then triggered the required automation logic.

The actual implementation logic was maintained in Script Files following the Page Object Model design pattern. This helped us separate UI element locators and reusable methods from test logic, improving maintainability and reducing code duplication.

Since the application supported both Android and iOS platforms, we handled platform-specific elements separately. We used interfaces and implemented different Android and iOS classes for the same functionality. Based on the execution platform, the framework dynamically called the appropriate Android or iOS implementation from the Script layer. This approach helped us achieve better scalability, reusability, and cleaner framework architecture.

The framework also improved collaboration between manual testers, developers, and automation engineers because the BDD Feature Files were easy to understand and aligned closely with business requirements.

Question3: How to handle scrolling without touch event?

Answer:

Scrolling can be handling without using touch event using the following script in Android and Ios

For Android:

driver.findElementByAndroidUIAutomator(“new UiScrollable(new UiSelector().scrollable(true))” +”.scrollIntoView(new UiSelector().text(\”element text\”));”);

For Ios:

driver.findElement(MobileBy.iOSNsPredicateString("label == 'element text'"));

Script for Scrolling with TouchAction:

import io.appium.java_client.TouchAction;
import io.appium.java_client.touch.WaitOptions;
import io.appium.java_client.touch.offset.PointOption;
import static java.time.Duration.ofMillis;
 
// Assuming screen size is needed
Dimension size = driver.manage().window().getSize();
int startX = size.width / 2;
int startY = (int) (size.height * 0.8);
int endY = (int) (size.height * 0.2);

TouchAction action = new TouchAction(driver);
action.press(PointOption.point(startX, startY))
      .waitAction(WaitOptions.waitOptions(ofMillis(800)))
      .moveTo(PointOption.point(startX, endY))
      .release()
      .perform();

Question4: Find the duplicates from String str = “Testing automation” and return using Selenium and C#?

Answer:

I have explained script below for find the duplicates using Selenium and C#:

using System;
using System.Collections.Generic;
using NUnit.Framework;

namespace SeleniumNUnitDemo
{
public class Tests
{
[Test]
public void FindDuplicateCharacters()
{
string str = “Testing automation”;

        Dictionary<char, int> charCount = new Dictionary<char, int>();

        foreach (char c in str.ToLower())
        {
            // Skip spaces
            if (char.IsWhiteSpace(c))
                continue;

            // Count characters
            if (charCount.ContainsKey(c))
                charCount[c]++;
            else
                charCount[c] = 1;
        }

        Console.WriteLine("Duplicate characters:");

        foreach (var pair in charCount)
        {
            if (pair.Value > 1)
            {
                Console.WriteLine($"{pair.Key} : {pair.Value}");
            }
        }
    }
}

}

Explanation-

This program is written using C# with NUnit and is used to find duplicate characters in a string. Instead of using the Main() method like a normal console application, NUnit executes the method marked with the [Test] attribute automatically. This type of program is commonly used in Selenium automation interview preparation to demonstrate knowledge of collections, loops, and string handling.

The statement using System; is included to access basic C# functionalities such as Console.WriteLine(). The statement using System.Collections.Generic; is required because the program uses Dictionary<char, int>, which belongs to the generic collections namespace. The statement using NUnit.Framework; is necessary for NUnit annotations like [Test].

The line namespace SeleniumNUnitDemo is used to organize the code into a logical group. A namespace helps avoid naming conflicts when multiple classes or projects contain similar names. Inside the namespace, the class Tests is created to hold the test methods.

The [Test] attribute tells NUnit that the method FindDuplicateCharacters() is a test case. When the test is executed from Visual Studio or NUnit Test Explorer, NUnit automatically detects and runs this method. Because NUnit controls execution, there is no need to use static void Main().

Inside the method, the string variable str stores the value "Testing automation". This is the input string on which duplicate character checking is performed. The program then creates a dictionary named charCount to store characters and their occurrence counts.

The foreach loop reads every character from the string one by one. The method ToLower() converts all characters into lowercase so that uppercase and lowercase letters are treated equally. For example, T and t will both be considered as t.

The condition char.IsWhiteSpace(c) checks whether the current character is a space. If the character is a space, the continue statement skips that iteration and moves to the next character. This prevents spaces from being counted.

The condition charCount.ContainsKey(c) checks whether the character already exists inside the dictionary. If the character is already present, the count is increased using charCount[c]++. If the character appears for the first time, it is added to the dictionary with an initial count of 1.

After counting all characters, the program prints the heading "Duplicate characters:" using Console.WriteLine(). Another foreach loop is then used to read all key-value pairs from the dictionary.

The condition if (pair.Value > 1) checks whether a character appears more than once. Only duplicate characters satisfy this condition. Finally, Console.WriteLine($"{pair.Key} : {pair.Value}") displays the duplicate character along with its count using string interpolation.

The expected output of the program is:

Duplicate characters:
t : 4
a : 2
o : 2
i : 2
n : 2

Question5: What is the difference between class and interface?

Answer:

Class:

A class is like a blueprint for objects—it defines properties (variables) and behaviors (methods) that the object will have.

  • Can contain both implementation and declaration.
  • Supports constructors, fields, and full method bodies.
  • Can be instantiated—you can create objects from a class.
  • Can use access modifiers (public, private, etc.).
  • Supports inheritance, but typically only single inheritance (extends one class).

Interface:

An interface is a contract—a list of methods that a class agrees to implement.

  • Contains only method signatures and constants (until Java 8 and later, which allows default and static methods).
  • Cannot be instantiated—it’s purely abstract.
  • A class can implement multiple interfaces, helping with multiple inheritance.

Great for enforcing consistent behavior across unrelated classes

Question 6: What is reason for multiple inheritance does not possible with C#?

Answer:

In C#, multiple inheritance is not supported for classes primarily to avoid complexity and ambiguity—most famously known as the Diamond Problem.

The Diamond Problem:

Suppose you have:

  • Class A defines a method Display()
  • Class B and Class C both inherit from A and override Display()
  • Now you create a class D that inherits from both B and C

If you call Display() from an instance of D, C# wouldn’t know which version to use—B’s or C’s. This ambiguity is messy and can lead to unpredictable behavior

Question 7:Why do we need to use virtual for the method in c#?

Answer:

In C#, the virtual keyword is used to enable polymorphism, which is a core concept in object-oriented programming.
When you declare a method as virtual in a base class, it means: “This method has a default behavior, but I’m allowing subclasses to override it if they need to.
 
Example:
class Animal {
    public virtual void Speak() {
        Console.WriteLine("Animal speaks");
    }
}
 
class Dog : Animal {
    public override void Speak() {
        Console.WriteLine("Dog barks");
    }
}

Tips to Crack Testing Interview:

1.     Prepare well on scripting if it automation interview
2.     Need of minimal automation knowledge for manual testing too
3.     Prepare for the key concepts of testing before interview
4.     Practice is more important for automation than study the concepts
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Subscribe to our YouTube Channel: Testing Talks Latest
Testingtalkslatest.com - A project by CreativeHub IT Solutions.
Contact Us At: support@testingtalkslatest.com
Our Partner websites - Classified Hub , CodesToolbox
Scroll to Top
0
Would love your thoughts, please comment.x
()
x