NatWest Group
Teleperformance Interview Questions and Answers
Q1. Wait in selenium and how to find all links present in a page xpath
To wait in Selenium, we can use explicit and implicit waits. To find all links in a page using XPath, we can use the findElements() method.
To wait in Selenium, we can use explicit wait with ExpectedConditions or implicit wait with the setScriptTimeout() method.
Explicit wait waits for a certain condition to occur before proceeding with the next steps.
Implicit wait sets a maximum time for the driver to wait for an element to appear.
To find all links in a page using XPath, we ca...read more
Q2. What is page object model and test ng annotations
Page Object Model (POM) is a design pattern used in test automation to create an object repository for web UI elements.
POM helps in creating reusable and maintainable code by separating the test logic from the page-specific details.
Each web page is represented as a separate class, and the UI elements and their actions are defined as methods within that class.
POM improves code readability, reduces code duplication, and enhances test maintenance.
TestNG annotations are used in T...read more
Q3. How to handle alert in selenium and methods
To handle alerts in Selenium, we use the Alert interface and its methods.
To switch to an alert, we use the switchTo() method of WebDriver class.
To accept or dismiss an alert, we use the accept() or dismiss() method of Alert interface.
To get the text of an alert, we use the getText() method of Alert interface.
To send text to an alert, we use the sendKeys() method of Alert interface.
Q4. How to take screenshot and project framework
To take a screenshot in automation testing, use the built-in methods provided by the testing framework.
In Selenium, use the getScreenshotAs() method to capture a screenshot.
In Appium, use the getScreenshotAs() method to capture a screenshot.
In TestNG, use the ITestResult interface to capture a screenshot on test failure.
In Cucumber, use the After hook to capture a screenshot after each scenario.
Q5. What is software testing life cycle
Software Testing Life Cycle (STLC) is a process followed to ensure quality in software development by conducting various testing activities.
STLC consists of several phases: requirement analysis, test planning, test case development, test environment setup, test execution, and test closure.
Each phase has specific objectives and deliverables, ensuring that the testing process is systematic and thorough.
STLC helps in identifying defects early, reducing the cost of fixing them, a...read more
Q6. How many locator is present in selenium
There are 8 locators present in Selenium.
Selenium provides 8 different locators to identify elements on a web page.
The locators are: ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, CSS Selector, and XPath.
Each locator has its own syntax and usage.
For example, to locate an element by ID, you can use driver.findElement(By.id("elementId"));
Q7. How to find broken link
To find broken links, use a link checker tool or browser extension.
Use a link checker tool like Xenu's Link Sleuth or W3C Link Checker
Install a browser extension like Check My Links for Chrome or Link Checker for Firefox
Manually check links by clicking on them and checking for error messages
Regularly check for broken links to ensure website functionality
Reviews
Interviews
Salaries
Users/Month