Scenario Based Interview Questions For Automation Tester
Scenario Based Interview Questions For Automation Tester
Interview
Questions for
Automation
Tester
With Answers
By Mayur Nikam
https://www.linkedin.com/in/mayur-nikam-369b31241
1) Your automated tests for a login page are failing
intermittently. How would you investigate and address
this issue?
If my login tests were acting up, I'd start by looking for patterns.
For example, maybe the failures only happen on Mondays after a
new deployment, or only when using Firefox. Then I'd check the
environment.
Once, I had tests failing because the test server kept running out of
memory. Of course, I'd review my code.
And I always check the logs – one time, the browser console showed
a JavaScript error that was causing the login button to be disabled.
2) The website you're testing has elements that
constantly change IDs or positions. What techniques
would you use to create reliable locators for your tests?
I've worked with sites where element IDs were generated
dynamically, making them different every time the page loaded. To
handle that, I relied on more stable attributes.
Let's say the login button is always inside a div with the class 'login-
form'. I could use an XPath like //div[@class='login-form']//button
to find it reliably.
3) A critical API endpoint is returning unexpected errors.
How would you use automation to help debug this?
I'd add assertions to check things like the response code – for a
successful login, I'd expect a 200 OK. I'd also make sure the response
body contains the expected data, like a user token.
And if the API is slow, I might use JMeter to simulate a heavy load
and see how it performs under stress.
4) Your web application needs to work flawlessly across
different browsers (Chrome, Firefox, Safari). How would
you approach cross-browser test automation?
In a previous project, we used Selenium Grid to run our tests on
Chrome, Firefox, and Safari. We had a Jenkins server that would
trigger the tests automatically whenever we pushed new code.
Then I'd use my testing framework (like TestNG or JUnit) to read this
data and run the tests with each data set. I've also used libraries like
Faker to generate realistic test data, like names, addresses, and
email addresses.
7) The company is prioritizing mobile users. How would
you automate testing on different mobile devices and
operating systems?
I have experience using Appium to automate tests for both Android
and iOS apps. In one project, we used Appium to test a shopping
app.
It's all about finding the right balance between automation and
manual testing to ensure comprehensive coverage.
9) You're tasked with automating tests for an old
application with limited documentation. How would you
approach this?
If I had to automate tests for an older application without much
documentation, I'd focus on a few key things.
First, I'd work closely with the development team to understand the
application's core functions and identify the most critical areas to
test.
To make sure our automated tests are really valuable, I'd want them
to be a core part of our CI/CD pipeline. Let's say we're using Jenkins.
I'd set things up so that every time the developers push new code,
Jenkins automatically kicks off a build. Then, as soon as that build is
done, Jenkins would trigger my automated tests.
But it's not just about running the tests, it's about making the results
easy to understand. I'd configure Jenkins to create clear reports,
maybe even with some nice graphs, showing which tests passed,
which failed, and how long everything took.
That way, everyone on the team can quickly see if there are any
problems. And if a test does fail, the pipeline should immediately let
the developers know so they can fix it right away. This keeps the
feedback loop tight and helps us catch bugs early on.