Capgemini
50+ ASCO Consultancy Services Interview Questions and Answers
Q1. 1] Introduction 2] Sanity Vs Smoke testing 3] Waits in selenium and code for it 4] Scenario based questions 5] types of frameworks 6] how to read data from excel 7] Coding questions based on- handling dropdown ...
read moreInterview questions for Automation Test Engineer
Sanity testing is a subset of regression testing while smoke testing is a subset of acceptance testing
Waits in Selenium are used to synchronize the test execution with the application's response
Types of frameworks include data-driven, keyword-driven, and hybrid frameworks
Reading data from Excel can be done using Apache POI library
Handling dropdown in Selenium can be done using Select class
Database automation can be done using JD...read more
Q2. What is assertion? What is soft assertion? What is hard assertion?
Assertion is a validation point to check if the expected result matches the actual result. Soft assertion doesn't stop the test execution on failure, while hard assertion does.
Assertion is a way to validate if the expected result matches the actual result
Soft assertion doesn't stop the test execution on failure, but logs the failure and continues with the test
Hard assertion stops the test execution on failure and marks the test as failed
Example of soft assertion: verifying mu...read more
Q3. What is TestNG? Write the methods name? Importance.
TestNG is a testing framework for Java that supports various testing types and provides advanced features like parallel testing and reporting.
TestNG stands for Test Next Generation.
It supports various testing types like unit, functional, integration, and end-to-end testing.
TestNG provides annotations like @Test, @BeforeSuite, @AfterSuite, etc. to define test methods and their execution order.
It supports parallel testing, which helps in reducing the overall test execution time...read more
Q4. How to write good test cases? What is required when you creating test plan?
Good test cases require clear objectives, thorough planning, and attention to detail.
Identify the objective of the test case
Ensure the test case is specific, measurable, achievable, relevant, and time-bound (SMART)
Consider all possible scenarios and edge cases
Document the expected results
Include preconditions and post-conditions
Ensure the test case is repeatable and reproducible
Review and validate the test case with stakeholders
Q5. What is parallel testing? Write the code.
Parallel testing is running multiple tests simultaneously to save time and increase efficiency.
Parallel testing is useful for large test suites that take a long time to run.
It requires a test framework that supports parallel execution.
Code example: pytest -n 4 (runs 4 tests in parallel)
Parallel testing can be done on multiple machines or on a single machine with multiple cores.
It can help identify and isolate issues faster.
Parallel testing can also help with load testing and ...read more
Q6. How many joins are there in Sql. Write the query for each joins.
There are four types of joins in SQL: Inner Join, Left Join, Right Join, and Full Outer Join.
Inner Join: returns only the matching rows from both tables
Left Join: returns all the rows from the left table and matching rows from the right table
Right Join: returns all the rows from the right table and matching rows from the left table
Full Outer Join: returns all the rows from both tables, with NULL values in the columns where there is no match
Q7. Insert the value in text box by using excel sheet through Selenium.
To insert value in text box using excel sheet through Selenium, we need to read data from excel and use sendKeys() method.
Read data from excel using Apache POI or JXL library
Identify the text box element using Selenium
Use sendKeys() method to insert the value from excel into the text box
Q8. What is agile methodology? What is CI CD pipe line?
Agile methodology is an iterative approach to software development that emphasizes collaboration, flexibility, and customer satisfaction. CI/CD pipeline is a set of practices that automate the process of building, testing, and deploying software.
Agile methodology involves breaking down a project into smaller, more manageable pieces called sprints.
Each sprint involves a cross-functional team working together to deliver a working product increment.
CI/CD pipeline involves contin...read more
Q9. How will you track the task in Jira?
To track tasks in Jira, I will create issues, assign them to team members, set priorities, and update their status.
Create issues in Jira for each task
Assign the issues to team members
Set priorities for each issue
Update the status of each issue as it progresses
Use Jira's reporting features to track progress and identify bottlenecks
Q10. What do you mean by automation testing?
Automation testing refers to the use of software tools to execute pre-scripted tests on a software application.
Automation testing involves writing scripts to automate repetitive manual testing tasks
It helps in reducing the time and effort required for testing
It improves the accuracy and reliability of testing results
Examples of automation testing tools include Selenium, Appium, and TestComplete
Q11. Take the backup of the table and insert the value in the same table of another database.
To take backup of a table and insert values in the same table of another database.
Use SQL Server Management Studio to take backup of the table
Restore the backup in the target database
Use SQL queries to insert values from source table to target table
Q12. Write the cod for switching between browser's tab?
Code for switching between browser's tab
Use driver.switchTo().window() method to switch between tabs
Pass the window handle of the tab to be switched to as argument
Get the window handles of all tabs using driver.getWindowHandles() method
Example: String currentTab = driver.getWindowHandle(); driver.switchTo().window(currentTab);
Example: Set
allTabs = driver.getWindowHandles(); driver.switchTo().window(allTabs.toArray()[1]);
Q13. OOPs concept and where you have used oops concept in your project.
OOPs is a programming paradigm based on the concept of objects. I have used OOPs in my project for code reusability and modularity.
Encapsulation, Inheritance, Polymorphism, Abstraction are the pillars of OOPs
I have used inheritance to create a base class for all the test cases and derived classes for specific test cases
I have used encapsulation to hide the implementation details of the test cases
I have used polymorphism to override the base class methods in the derived classe...read more
Q14. Describe your framework and project?
My framework is a hybrid framework that uses both data-driven and keyword-driven approaches. The project is a web-based application for e-commerce.
The framework uses Selenium WebDriver for web automation
It has a modular structure with reusable components
Test data is stored in Excel sheets and accessed using Apache POI
Test cases are written in Java and organized using TestNG
Reporting is done using ExtentReports
The project involves testing various functionalities of an e-commer...read more
Q15. Difference between Keyword driven, Data driven and Hybrid framework?
Keyword driven, Data driven and Hybrid are automation frameworks used in software testing.
Keyword driven framework uses keywords to represent actions and data to be used in testing
Data driven framework uses external data sources to drive the test cases
Hybrid framework combines both keyword and data driven approaches
Keyword driven is best suited for applications with complex user interfaces
Data driven is best suited for applications with large amounts of data
Hybrid is best sui...read more
Q16. What is sprint in agile methodology?
A sprint is a time-boxed period in Agile methodology during which a team completes a set amount of work.
Sprints usually last 1-4 weeks
At the beginning of each sprint, the team plans the work they will complete
The team works on the planned work during the sprint
At the end of the sprint, the team demonstrates the completed work to stakeholders
The team then reflects on the sprint and plans for the next one
Q17. what is static,final in java? what is the difference between string buffer and string builder? write a program to dispaly below pattern 1 2 3 4 5 6 7 8 9 10
Static and final are keywords in Java. StringBuffer is synchronized while StringBuilder is not. The pattern can be displayed using loops.
Static keyword is used to create class-level variables or methods. Final keyword is used to make a variable constant.
StringBuffer is synchronized and thread-safe, while StringBuilder is not synchronized and faster.
Pattern program can be implemented using nested loops to print the desired pattern.
Q18. Describe final key, static, finally, finalized, garbage collection.
Explanation of final key, static, finally, finalized, garbage collection.
Final key - used to declare a constant value that cannot be changed
Static - used to declare a variable or method that belongs to the class rather than an instance of the class
Finally - used to define a block of code that will be executed regardless of whether an exception is thrown or not
Finalized - a method that is called by the garbage collector before an object is destroyed
Garbage collection - automat...read more
Q19. code to check the current webpage url,types of functional testing,authentication nd authorisation, http methods,status codes,how to select dropdown 5th value,sql queries
Code to check current webpage URL, types of functional testing, authentication and authorization, HTTP methods, status codes, selecting dropdown value, and SQL queries.
To check current webpage URL, use driver.getCurrentUrl() in Selenium WebDriver.
Types of functional testing include smoke testing, regression testing, integration testing, etc.
Authentication ensures the user is who they claim to be, while authorization determines what actions they can perform.
HTTP methods includ...read more
Q20. Write the code for mouse click function?
Code for mouse click function
Use Selenium WebDriver's click() method to simulate mouse click
Identify the element using locators like ID, class name, xpath, etc.
Example: driver.findElement(By.id("elementID")).click();
Q21. concept of Javascript used in Selenium, i.e. write value without using sendkeys in selenium.
Javascript can be used in Selenium to execute scripts and interact with web elements. setValue() method can be used to write values without sendKeys().
JavascriptExecutor interface can be used to execute Javascript in Selenium
setValue() method can be used to set value of an input field without using sendKeys()
Example: JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("document.getElementById('elementId').value='value'");
Q22. write a code to take screen shot? write a code to print all the values from dropdown of selected type? write a code for implicit wait?
Code snippets for taking a screenshot, printing dropdown values, and implementing implicit wait in automation testing.
For taking a screenshot: Use Selenium's TakesScreenshot interface to capture the screenshot and save it to a file.
For printing dropdown values: Use Selenium's Select class to select the dropdown element and then iterate through all options to print their values.
For implicit wait: Use Selenium's WebDriverWait class with a specified timeout to wait for elements ...read more
Q23. What is POM? What is Maven?
POM stands for Page Object Model. Maven is a build automation tool.
POM is a design pattern used in test automation to create an object repository for web UI elements.
It helps in reducing code duplication and improves code maintainability.
Maven is a popular build automation tool used for managing dependencies and building Java projects.
It uses a pom.xml file to define project dependencies and configurations.
Maven can also be used for running tests and generating reports.
Q24. Is cucumber a testing tool?
No, Cucumber is not a testing tool.
Cucumber is a tool used for behavior-driven development (BDD) and not specifically for testing.
It allows non-technical stakeholders to understand and collaborate on the development process.
Cucumber uses a plain-text format called Gherkin to describe the behavior of an application.
It acts as a bridge between the business and technical teams, facilitating communication and ensuring that the software meets the desired behavior.
Cucumber can be i...read more
Q25. how to find color of webelement in selenium
To find the color of a webelement in Selenium, use the getCssValue() method.
Locate the webelement using any of the available locators in Selenium
Use the getCssValue() method to get the value of the CSS property 'color'
The value returned will be in the format 'rgba(255, 0, 0, 1)'
Use any color picker tool to convert the RGB value to the corresponding color name
Q26. Run only failed test cases from all.
To run only failed test cases, we can use testNG or JUnit annotations and configure the test suite accordingly.
Use testNG or JUnit annotations to mark the test cases as failed or passed
Configure the test suite to run only failed test cases
Use tools like Jenkins to automate the process
Example: @Test(enabled = true, retryAnalyzer = RetryAnalyzer.class) public void testMethod() {}
Example:
Q27. What is bug life cycle?
Bug life cycle is the process of identifying, reporting, resolving, and verifying software defects.
Bug is identified by testers or users
Bug is reported to the development team
Development team resolves the bug
Bug fix is verified by testers
Bug is closed if verified or reopened if not
Bug life cycle stages include new, open, assigned, resolved, verified, and closed
Q28. What is unit testing?
Unit testing is a software testing technique where individual units or components of a software application are tested in isolation.
Unit testing is done by developers during the development phase.
It helps in identifying defects early in the development cycle.
It ensures that each unit/component of the software application is working as expected.
Unit tests are automated and can be run frequently to ensure that changes made to the code do not break existing functionality.
Example...read more
Q29. Find the second high score in sql.
SQL query to find the second highest score.
Use the ORDER BY clause to sort the scores in descending order.
Use the LIMIT clause to limit the result to the second row.
Use a subquery to exclude the highest score from the result.
Q30. Program to insert data into map and retrieve it. Left Triangle pattern Program Hasmaps Strings
Program to insert and retrieve data from a map using strings.
Create a HashMap to store key-value pairs of strings.
Use put() method to insert data into the map.
Use get() method to retrieve data from the map.
Q31. does java support inheritance? and where?,
Yes, Java supports inheritance.
Inheritance is a fundamental feature of object-oriented programming in Java.
It allows a class to inherit properties and methods from another class.
The 'extends' keyword is used to establish an inheritance relationship.
The subclass inherits all the non-private members of the superclass.
Inheritance promotes code reusability and allows for polymorphism.
Example: class B extends A { ... }
Q32. What are locators?
Locators are identifiers used to locate web elements on a webpage for automation testing.
Locators can be based on ID, class name, name, tag name, link text, partial link text, CSS selector, or XPath.
For example, a locator for a login button could be 'id=loginButton' or 'xpath=//button[contains(text(),'Login')]'.
Choosing the right locator is important for reliable and efficient test automation.
Locators can be stored in a separate file or class for easy maintenance and reuse.
Q33. write a java program to find the frequency of character in a string.
Java program to find frequency of characters in a string.
Create a HashMap to store characters and their frequencies.
Iterate through the string and update the frequencies in the HashMap.
Print the frequencies of each character in the string.
Q34. Dynamic xpath Explain how have u implemented oops concept in ur framework
Implemented OOPs concepts in framework by creating classes for pages, utilities, and test cases.
Used inheritance to create base classes for common functionalities
Encapsulated data and methods within classes to promote reusability
Implemented polymorphism to allow different actions based on context
Utilized abstraction to hide complex implementation details from users
Q35. which locater in selenium is fastest
The fastest locator in Selenium is By ID.
By ID is the fastest locator in Selenium as it directly targets the unique ID attribute of an element.
Using By ID reduces the time taken to locate an element compared to other locators like By XPath or By CSS Selector.
Example: driver.findElement(By.id("elementID"));
Q36. difference between scenario and scenario outline in BDD framework
Scenario is a single test case in BDD framework, while scenario outline is a template for multiple similar test cases.
Scenario is a single test case with specific inputs and expected outcomes.
Scenario outline is a template for multiple similar test cases, with placeholders for different inputs.
Scenario outline uses Examples section to provide different sets of inputs for each test case.
Scenario outline helps in reducing duplication of test cases by using parameterization.
Q37. Remove duplicates in an array
Remove duplicates in an array
Use a hash table to keep track of elements already seen
Sort the array and remove duplicates in a single pass
Q38. Most Occurrence in given string Largest second number Reverse the String itself
The question involves finding the most occurring character in a given string, finding the second largest number in the string, and reversing the string itself.
To find the most occurring character, iterate through the string and keep track of the count of each character using a dictionary or array.
To find the second largest number, iterate through the string and convert each substring to a number. Keep track of the largest and second largest numbers.
To reverse the string, use ...read more
Q39. Write the xpath manually
Answering the question to write an xpath manually.
Identify the element to be located
Determine the unique attributes of the element
Construct the xpath using the identified attributes
Test the xpath to ensure it accurately locates the element
Q40. Find the duplicate value.
To find duplicate values, iterate through the list and compare each element with the rest of the list.
Create an empty list to store the duplicate values.
Iterate through the list and compare each element with the rest of the list.
If a duplicate is found, add it to the duplicate list.
Return the duplicate list.
Q41. Why main method is static in java
Main method is static in Java to allow it to be called without creating an instance of the class.
Static methods can be called without creating an instance of the class.
Main method is the entry point of a Java program, so it needs to be accessible without creating objects.
Static methods belong to the class rather than any specific instance.
Q42. What is string and why it is immutable
A string is a sequence of characters. It is immutable because once created, its value cannot be changed.
Strings are used to represent text data in programming languages.
Immutable means that the value of a string cannot be altered once it is created.
Any operation that appears to modify a string actually creates a new string with the modified value.
Example: 'hello' -> 'hello world'
Q43. Diff between hashmap table
Hashmap is a collection of key-value pairs while table is a data structure with rows and columns.
Hashmap is used for fast retrieval of values based on keys.
Table is used for storing and organizing data in rows and columns.
Hashmap can have duplicate values but not duplicate keys.
Table can have duplicate values in different rows and columns.
Hashmap is implemented using hashing while table is implemented using arrays or linked lists.
Example of Hashmap: HashMap
map = new HashMap<...read more
Q44. Write a api to fetch the employee details
API to fetch employee details
Create a GET endpoint /employees to fetch all employee details
Include parameters like employee ID or department to filter results
Return employee details in JSON format with fields like name, age, position, etc.
Q45. Difference between web driver and Chromedriver
WebDriver is a general interface for web automation, while ChromeDriver is a specific implementation for Chrome browser.
WebDriver is a generic interface that allows interaction with different web browsers, while ChromeDriver is a specific implementation for Chrome browser.
WebDriver can be used to automate tests on various browsers like Chrome, Firefox, Safari, etc., while ChromeDriver is specifically designed for Chrome browser automation.
WebDriver provides a common set of co...read more
Q46. Write a program for Fibonacci series?
Program to generate Fibonacci series using iterative approach.
Initialize variables for first two numbers in the series (0 and 1)
Use a loop to generate subsequent numbers by adding the previous two numbers
Store the generated numbers in an array
Repeat the process until desired number of Fibonacci numbers are generated
Q47. What is mutable and immutable
Mutable objects can be changed after creation, while immutable objects cannot be changed.
Mutable objects: Lists, dictionaries, sets
Immutable objects: Strings, tuples, numbers
Example: Changing a list by adding or removing elements vs. trying to change a string
Q48. Explain about Oops concepts
Oops concepts are the principles of Object-Oriented Programming that focus on encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: bundling data and methods together in a class
Inheritance: creating new classes from existing ones
Polymorphism: ability of objects to take on many forms
Abstraction: hiding unnecessary details and exposing only essential features
Q49. Write a program for decorators?
Decorators in Python are a design pattern that allows behavior to be added to individual objects.
Decorators are functions that modify the behavior of other functions.
They are used to add functionality to existing functions without changing their code.
Decorators are commonly used in Python with the @ symbol before the function definition.
Example: Creating a decorator to log the execution time of a function.
Q50. Explain about locators in selenium
Locators in Selenium are used to identify web elements on a web page.
Locators are used to find and interact with web elements on a web page.
There are different types of locators in Selenium such as ID, Name, Class Name, Tag Name, Link Text, and Partial Link Text.
Locators can be used with various Selenium commands such as click(), sendKeys(), getText(), etc.
Using the right locator strategy is important for efficient and reliable test automation.
Example: driver.findElement(By.i...read more
Q51. WAP to reverse a string
A program to reverse a given string
Create an empty string to store the reversed string
Iterate through the given string from the end and append each character to the new string
Return the reversed string
Q52. explain the framework
A framework is a set of guidelines, standards, and tools used to develop and execute automated tests efficiently.
A framework provides a structure for organizing test cases and test data.
It helps in reducing the time and effort required for test automation.
Frameworks can be data-driven, keyword-driven, or hybrid.
Examples of popular frameworks include Selenium, Appium, and TestNG.
Q53. Inheritance types in Java
Inheritance types in Java include single, multilevel, hierarchical, and hybrid inheritance.
Single inheritance: A class can only inherit from one superclass.
Multilevel inheritance: A class can inherit from a superclass, which in turn inherits from another superclass.
Hierarchical inheritance: Multiple classes inherit from a single superclass.
Hybrid inheritance: Combination of two or more types of inheritance.
Example: class B extends class A (single inheritance), class C extends...read more
Q54. Software Testing life cycle
Software Testing life cycle involves planning, designing, executing, and reporting on tests to ensure quality software.
1. Planning phase involves defining test objectives, scope, and strategy.
2. Design phase includes creating test cases, test data, and test environment setup.
3. Execution phase is where tests are run, defects are logged, and results are recorded.
4. Reporting phase involves analyzing test results, reporting defects, and providing feedback for improvements.
5. It...read more
Q55. how to scroll a page
To scroll a page, use JavaScript to execute a scroll function.
Use window.scrollTo(x-coord, y-coord) to scroll to a specific position on the page.
Use window.scrollBy(x-pixels, y-pixels) to scroll by a certain amount of pixels.
Use document.getElementById('elementId').scrollIntoView() to scroll to a specific element on the page.
Q56. verify vs assert
Verify and assert are two different methods used in automation testing.
Verify is used to check if a condition is true or false without stopping the test execution.
Assert is used to check if a condition is true or false and if it is false, it stops the test execution.
Verify is generally used for non-critical validations, while assert is used for critical validations.
Examples: verify if a button is enabled, assert if a login is successful.
Q57. Explain framework
A framework is a set of guidelines, libraries, and tools that help in developing and executing automated tests efficiently.
Framework provides structure and organization to automated tests
It includes reusable components like libraries, functions, and utilities
Frameworks can be data-driven, keyword-driven, or hybrid
Examples: Selenium WebDriver for web automation, Appium for mobile automation
Q58. Explain STLC process
STLC (Software Testing Life Cycle) is a systematic process for testing software applications.
STLC involves planning, designing, executing, and reporting on tests.
It includes phases like requirement analysis, test planning, test design, test execution, and test closure.
Each phase has specific activities and deliverables to ensure thorough testing of the software.
STLC helps in identifying defects early in the development cycle, reducing costs and improving software quality.
More about working at Capgemini
Top HR Questions asked in ASCO Consultancy Services
Interview Process at ASCO Consultancy Services
Top Automation Test Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month