LTIMindtree
TCS Interview Questions and Answers
Q1. Explain framework used for selenium
Selenium is an open-source automation testing framework used for web applications.
Selenium supports multiple programming languages like Java, Python, C#, etc.
It consists of Selenium WebDriver, Selenium IDE, and Selenium Grid.
Selenium WebDriver is used for automating web applications by interacting with the web elements.
Selenium IDE is a record and playback tool for creating test cases.
Selenium Grid is used for parallel testing across different browsers and environments.
Q2. Checked and unchecked exceptions.
Checked exceptions are checked at compile time, while unchecked exceptions are not.
Checked exceptions must be either caught or declared in the method signature using 'throws' keyword.
Unchecked exceptions do not need to be explicitly handled.
Examples of checked exceptions include IOException, ClassNotFoundException.
Examples of unchecked exceptions include NullPointerException, ArrayIndexOutOfBoundsException.
Q3. Reverse String without using loop
Reverse string without using loop
Use recursion to reverse the string
Base case: if string length is 0 or 1, return the string
Recursive case: return the last character + reverse(rest of the string)
Q4. Parenthesis Balancing using stack
Implement a parenthesis balancing algorithm using a stack
Use a stack to keep track of opening parentheses
When encountering a closing parenthesis, pop from stack and check if it matches the closing parenthesis
If stack is empty or mismatched parentheses, return false
If all parentheses are balanced, return true
Q5. Exceptions in selenium
Exceptions in Selenium are errors that occur during test execution, such as ElementNotVisibleException or TimeoutException.
Selenium WebDriver throws exceptions when it encounters errors during test execution.
Common exceptions include NoSuchElementException, ElementNotVisibleException, TimeoutException, StaleElementReferenceException, and WebDriverException.
Handling exceptions in Selenium can be done using try-catch blocks or using TestNG annotations like @Test(expectedExcepti...read more
Q6. Waits in selenium
Waits in Selenium are used to synchronize tests with the browser's state.
Waits help to handle synchronization issues in Selenium tests
There are two types of waits in Selenium - Implicit Wait and Explicit Wait
Implicit Wait sets a default waiting time for the entire test script
Explicit Wait allows the test to wait for a certain condition to be met before proceeding
More about working at LTIMindtree
Interview Process at TCS
Top Sdet Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month