CGI Group
Interview Questions and Answers
Q1. what framework you are using in your project?
We are using the Selenium framework for automation testing in our project.
Selenium is a popular open-source automation testing framework
It supports multiple programming languages like Java, Python, C#, etc.
Selenium WebDriver is used for automating web applications
It provides features for browser automation, testing across different browsers, and parallel test execution
Q2. how to handle multiple tabs in selenium
Handling multiple tabs in Selenium involves switching between tabs and performing actions on each tab.
Use getWindowHandles() to get a set of window handles
Switch to a specific tab using switchTo().window(handle)
Perform actions on the tab
Close the tab if needed using driver.close()
Q3. why we use try and catch
Try and catch blocks are used in programming to handle exceptions and prevent the program from crashing.
Try block is used to enclose the code that might throw an exception
Catch block is used to handle the exception thrown in the try block
It prevents the program from crashing and allows for graceful error handling
Can also include finally block to execute code regardless of whether an exception is thrown
Q4. difference between findelement and findelements
findelement returns the first matching element on a webpage, findelements returns a list of all matching elements.
findelement returns a single WebElement, findelements returns a list of WebElements
findelement throws NoSuchElementException if no element is found, findelements returns an empty list
Example: driver.findElement(By.id("exampleId")) vs driver.findElements(By.className("exampleClass"))
Q5. Explain about the framework structure
Framework structure refers to the organization and layout of the automation framework components.
Framework structure includes modules, libraries, test scripts, configuration files, and test data.
It follows a hierarchical structure with layers such as driver scripts, reusable libraries, and test cases.
Frameworks can be structured as linear, modular, data-driven, keyword-driven, or hybrid.
Example: In a data-driven framework, test data is separated from test scripts for easy mai...read more
Q6. what is inheritance
Inheritance is a concept in object-oriented programming where a class can inherit attributes and methods from another class.
Allows a class to inherit attributes and methods from another class
Promotes code reusability and reduces redundancy
Creates a parent-child relationship between classes
Derived class can access the properties and methods of the base class
Example: Class 'Car' can inherit from class 'Vehicle'
Q7. explain about hashmaps
Hashmaps are data structures that store key-value pairs and allow for efficient retrieval of values based on keys.
Hashmaps are also known as dictionaries, maps, or associative arrays.
They use a hash function to map keys to indices in an underlying array.
Hashmaps offer constant-time average case complexity for insertion, deletion, and lookup operations.
Example: HashMap
map = new HashMap<>(); map.put("key", 123); int value = map.get("key");
More about working at CGI Group
Interview Process at null
Top Automation Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month