This is a collection of interview questions that are not commonly asked when going for an interview. These questions are taken from problems that I/my team have actually faced while working with Selenium.
- How do you handle multiple levels of shadow DOM inside a web app that you are testing with Selenium?
We’ll create one function – that will expand the parent shadow-dom tree
Upon calling on multiple iterations on the nested shadow-dom elements, this will expand the parent shadow-dom,
and then try to find any element if we want inside it and then perform any action on that element.
- Let’s say we have a page where there is an auto-scroll functionality. How can you write a method using Selenium so that the scroll works until the last record ? How will you stop the scroll?
- Consider the following structure
– Main Window
– Iframe 1
– Iframe 2
User performs some action inside frame 2
In this scenario, how do a user returns to
– Main Window
– Iframe 1
- How to ignore a SSL certificate change error in Chrome using Selenium
- What are Pseudo-elements? How can we handle them using Selenium?
- What are the options of re-sizing the browser window in Selenium?
- Can I minimise a browser window in Selenium?
- When running Selenium in headless mode, a lot of the times we see people using these flags
–no-sandbox
–disable-shm-usage
Do you know what does these flags mean?
- How to send multiple whitespace characters in a single sendkeys statement in Selenium?
- Selenium 4 has been released. What are the new locators being talked about in Selenium 4?
- Have you ever implemented your Selenium code in Docker? Can you give an example?
- Have you heard of Allure reports? Have you integrated allure reports in Selenium?
- Can we interact with Chrome devtools in Selenium?
- How can you test a new Chrome extension using Selenium?
- Tell me about Screenshots in Selenium? How are they useful? A little bit about the implementation.
- Is it possible to find the cursor of the currently focussed element in the web page?
- Recently Selenium 4 was released. In Selenium 4 we can mock geo-location? Do you know how we can do that?
- What is localisation testing? How can we do localisation testing using Selenium?
- How do you stop auto-scrolling while testing a page in Selenium in Chrome browser?
- How do I ignore a SSL certificate change in Chrome when automating with Selenium?
- Do you know what are Pseudo elements? Do you know how to handle them in Selenium?
- Can I change the size of the browser in Selenium? If so how?
- So Selenium 4 has been released for a while now right? Do you know on an architecture level what is the difference between Selenium 3 and Selenium 4.
- Have you implemented loading of a custom profile in either Firefox or Chrome using Selenium?
- I’ve a Chrome extension that I want to test? Do you know how we can load an extension when running test suite using Selenium?
- Do you know what method can be used to get all the cookies pertaining to a web page in Selenium?
- Can I set a cookie which has domain other than the current domain under which Selenium tests are running?
- Can we add/remove items from browser localStorage using Selenium?
- Do you know if I can accept/reject a push notification using Selenium?
- Can I open multiple Chrome instances in a single Selenium test?
- How to add a proxy in Selenium tests?
- Do you have any idea of the concept of lazy loading? How do you automate this in Selenium?
- We have a click method in Selenium, and there is another click method that is available in JS. What is the difference in both?
- Can you tell me how can I set up Selenium Grid?
- How can I get the hyperlinks pertaining to a particular node in Selenium?
- How can I get
background-coloror any other such CSS property of an element in Selenium?
- Can In send an input text to a text box without using
sendkeys()method?
- Have you downloaded a file using Selenium? How can I change the download directory in Chrome browser for Selenium tests?
- How can I get the HTML source of a page in Selenium?
- What are the different Xpath axes that you know of? Can you explain them with examples?
- Let’s say you have a page like Facebook, where as you keep scrolling , the data keeps getting added. How can you handle such scenarios in automation?
- How can we work with SVG elements in Selenium? How can I write xpath for a SVG element?
- Have you heard of
pageLoadStrategyin Selenium?
- How can I get the data of a specific column when working with Selenium webdriver?
- Have you worked on automation of a grid like element – like ag-grid?
- How can I do a right / left scroll in Selenium?