• info@helpingtesters.com
  • helpingtesters

Selenium Interview Questions

August 30, 2015 Selenium Tutorial
selenium interview, selenium questions, selenium webdriver questions,

In this section, we will be sharing most commonly interview questions for Selenium WebDriver. You are going to any years experience profile, just revise below questions. 

The difference between Absolute path & Relative path

Absolute path starts from “HTML” example “html/body/div[5]/div[2]/div/” Relative path is in reference to example “By.xpath(“//table[@id=’name’]”

Scenario: There is building let’s generate its path:

Absolute
Zero Tower
Plot no. 2, Block 9
Jai Nath Street
Bangalore India
Relative
Tallest tower in Block 9, Bangalore

Tell me some TestNG Annotations

  • @BeforeSuite
  • @AfterSuite
  • @BeforeTest
  • @AfterTest
  • @BeforeGroups
  • @AfterGroups
  • @BeforeClass
  • @AfterClass
  • @BeforeMethod
  • @AfterMethod

What are Desired capabilities

Desired Capability is a series of key/value pairs that encapsulate aspects of a browser means we can set the behavior of the browser on the run time. Basically, the Desired Capabilities help to set properties for the WebDriver. A typical use case would be to set the path for the FireFoxDriver if our local installation doesn’t correspond to the default settings.

The difference between Selenium RC and Selenium Web driver

  • Selenium RC is old version of Selenium Web Driver
  • In Selenium RC we need to start the server, it acts as communication between Selenium RC and browser. Server injects code into the browser and executes automation.
  • In case of WebDriver, it communicates directly with Selenium RC
  • Also simple language we can selenium Webdriver is supported for Java Object Orient Programming.

What is Automation Framework

The framework is a process which will make automation develop and maintain in a team. Framework includes what would be folder structure, Common function library, how would be storing and fetching test data, how would be storing result, how continuous integration will be performed etc

What is the Difference between driver.Close() and driver.Quit () method?

Driver.close(): will close the browser which is in focus of web driver object

Driver.quit(): will close all the browsers and closes the session

How can we get the font size, font color, font type used for a particular text on a web page using Selenium web driver

System.out.println(“WebElement Font Size is : “+ driver.findElement(By.id(“submitbox”)).getCssValue(“font-size”));

System.out.println(“WebElement Font Color is : “+driver.findElement(By.id(“submitbox”)).getCssValue(“font-color”));

System.out.println(“WebElement Font Background Color is : “+driver.findElement(By.id(“submitbox”)).getCssValue(“background-color”));

How to Run Tests in Multiple Browser Parallel

Selenium-Grid allows you run your tests on different machines against different browsers in parallel

What is Selenium 2.0

Selenium 1.0:  Selenium RC

Selenium 2.0: Selenium WebDriver

How will you find an element using Selenium

  • By ClassName
  • By CssSelector
  • By ID
  • By LinkText
  • By Name
  • By TagName
  • By XPath

Mention what is the use of X-path

We can interact with Website with properties ID, CLASSNAME, NAME etc XPath is another way to navigate through elements and attributes in an XML document. As per W3C:

  • XPath is a syntax for defining parts of an XML document
  • XPath uses path expressions to navigate in XML documents
  • XPath contains a library of standard functions
  • XPath is a major element in XSLT
  • XPath is a W3C recommendation

Technical Challenges with Selenium

  • Selenium Supports only web based applications
  • It doesn’t support any non-web based (Java Applet, Java Swing, .Net Client Server etc) applications
  • Since Selenium is a free tool, there is no direct support available
  • Bitmap comparison is not supported by Selenium
  • No direct reporting, logging, test data handling feature available
  • Need to learn language for scripting with selenium
  • Sometimes pages take more time to load when working with Selenium.
  • For uploading and downloading file no separate feature present, sometimes need to take help of window automation tools like AutoIT.
  • No built in repository available, have to use .properties file or other feature to create object repository

What are the Advantages of Selenium

  • Supports multiple browsers
  • Provides the option of using wide range of IDEs such as Eclipse, Netbeans etc
  • Supports multiple languages JAVA, NET, Ruby etc
  • Very large Selenium community
  • Selenium is open source. Most open source tools support other open source tools
  • Selenium supports Continuous Integration
  • Various options to find element on website
  • Same developed scripts run on multiple browsers

Mention what is the Difference between Implicit wait and Explicit wait?

We tell the web driver to wait for specific time suppose 10seconds before any web element Implicit wait: be visible on the website. The implicit wait is applied to all element present after declaring once. 

Implicit wait: is applied to all element present after declaring once. If an element is visible in 2 seconds that web driver won’t wait for next 8 seconds.

Explicit wait: wait is applied for a specific element, not all elements. In Explicit wait, we tell web driver to wait for this specific element till any condition is fulfilled. Example wait for submit button for 10 seconds till the element becomes clickable.

Explain what is the Difference between find element() and find elements()

findElement() will return only single WebElement and if that element is not located or we use some wrong selector then it will throw NoSuchElement exception. If multiple elements are present with the same selector then it will give the first element.

findElements() will return List of WebElements – for this, we need to give locator in such a way that it can find multiple elements

Explain what is Data driven framework and Keyword driven

Data-driven framework: In this test are created, verified and executed on the basis of test data stored in some database either Excel, SQL etc. In the simplest form, the tester supplies the inputs from a row in the table and expects the outputs which occur in the same row.

Keyword-driven framework: Also known as table-driven testing or action word based testing. This method separates the documentation of test cases -including the data to use- from the prescription of the way the test cases are executed. As a result, it separates the test creation process into two distinct stages: a design and development stage, and an execution stage.

What is Object Repository

Object Repository is the location where we can store information/properties of our elements, scripts identify the properties from Object Repository to identify them.

How do you verify if the Checkbox/Radio is checked or not

driver.findElement(By.id(“submitbutton”)).getAttribute(“checked”)

How do you launch IE/chrome browser

You need to download the executable file for chrome/IE and run commands

System.setProperty(“webdriver.chrome.driver”, “path to executable file”);

WebDriver driver = new ChromeDriver();

How do you upload a file

We can use Selenium “sendKeys” function if it didn’t work then we need to use help of windows Automation Tools like Auto IT

How do you get the current page URL

driver.getCurrentURL();

How to get typed text from a textbox

driver.findElement(By.id(“submitbutton”)).getAttribute(“text”);

or

driver.findElement(By.id(“submitbutton”)).getText();

What are the prerequisites to run selenium web driver

Knowledge of Java and any other supported Programming language

What is Selenium Grid

Selenium Grid allows you run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines running different browsers and operating systems

How to get the title of the page

driver.getTitle();

FirefoxDriver is class or an interface

Class

How do you handle https website in selenium

FirefoxProfile myProfile = allProfiles.getProfile(“CertificateIssue”);
myProfile.setAcceptUntrustedCertificates(true);

HtmlUnitDriver

HTML unit driver is the lightest weight and fastest implementation headless browser for WebDriver

What are the benefits of using TestNG

  • It generates logs.
  • You can do parallel testing.
  • Annotations help to set program/function priority easy.
  • Allow generating HTML report of execution.
  • You can group test cases.
  • You can set test cases priorities.
  • You can do data Parameterization.

What is the use of AutoIt tool

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting.

How to perform double click using WebDriver

Actions action = new Actions(driver);

WebElement element = driver.FindElement(By.id(“submit”))   action.DoubleClick(element).Build().Perform();

What is the difference b/w getWindowHandles() and getWindowHandle()

getWindowHandles()- is used to get the address of all the open browser and its return type is Iterator<String>.

getWindowHandle()- is used to get the address of the current browser where the control is and return type is String.

What are the limitations of Selenium IDE

Selenium IDE is record and play tool can only support Mozilla browser

How will you handle dynamic elements

We use Relative xPaths

 Which one is better XPath or CSS 

CSS Locator has better performance than the XPath Locator

What is actions class in WebDriver

The user-facing API for emulating complex user gestures. Use this class rather than using the Keyboard or Mouse directly.

About the author

Vaibhav Singhal author

Vaibhav is in software testing since a decade. Worked with different testing techniques along with exploratory testing. Performed different regression, performance, api etc testing with tools and libraries like selenium, jmeter, loadrunner, protractor, rest assured, Katalon Appium and others.

104 Comments

Sanjay Gupta

August 9, 2015 at 5:10 am

Information shared is really important for selenium interviews.

Really appreciated….Sanjay Gupta

    Vaibhav

    March 29, 2016 at 11:13 am

    thanks for your feedback

      Vaibhav

      March 29, 2016 at 11:23 am

      thanks

zdhb Hussain

August 10, 2015 at 11:13 pm

Thanks for sharing

Terry

October 22, 2015 at 12:28 am

very informative article to know about various selenium interview questions

Sandra

November 22, 2015 at 2:05 am

A enjoy reading all articles from this blog. thank you for sharing

Sandra

November 23, 2015 at 3:27 am

Hi my name is Sandra and I just wanted to drop you a quick note here instead of calling you. I came to your Selenium Interview Questions and they are great

Ganesh

January 4, 2016 at 7:37 pm

very well collection and explained well for beginners as well as for experienced

Rajesh

January 15, 2016 at 10:08 am

Very nice collection of interview questions

nidhi mongia

January 31, 2016 at 4:44 am

Excellent details.
In today industry it is good to go for Selenium or Appium. Are they different.

    Vaibhav

    March 29, 2016 at 11:22 am

    @Nidhi Selenium is for web automation & Appium for mobile automation.

Vamsi

February 6, 2016 at 4:22 pm

This is very good article and learnt alot from this article.

regards
Vamsi

    Vaibhav

    March 29, 2016 at 11:22 am

    thanks @Vasmi hope it help you

Irfan

February 12, 2016 at 8:29 am

Thanks for sharing

    Vaibhav

    March 29, 2016 at 11:21 am

    thnx

sudheesh

February 25, 2016 at 3:57 am

Thanks for sharing this document, its very useful. Well written, easy to grab. Thanks you very much

    Vaibhav

    March 29, 2016 at 11:20 am

    @Sudheesh welcome

Pullavi Jain

February 26, 2016 at 9:30 am

Thankyou so much for such an excellent article and clubing questions which will help the testers who are appearing for selenium interview

    Vaibhav

    March 29, 2016 at 11:20 am

    @Pullavi appreciated

Mohamed Asruf

February 26, 2016 at 4:14 pm

very useful and clear explanation. Well done

    Vaibhav

    March 29, 2016 at 11:19 am

    🙂

Jason

March 2, 2016 at 1:23 pm

Excellent Article. Thanks for sharing!!!!!

    Vaibhav

    March 29, 2016 at 11:19 am

    thanks @Jason

Anusha

March 9, 2016 at 4:14 pm

Very useful information…thanks for sharing

I have been reading all blog topics, it would be great if you can email the diffirence between various automation fameworks, practically.

thanks
Anusha

ravindra

April 2, 2016 at 7:50 pm

Very Very Useful article……

swati

April 4, 2016 at 2:54 am

Really the content is awesome. Hats off of you! Kindly keep posting these type of things. It will be useful to both the freshers and experienced people who enter to the testing field.

Natalie

April 4, 2016 at 6:22 pm

Good article.
Kindly post interview questions for manual tester ?
it will be helpful for many.

Vibhor

May 9, 2016 at 12:42 pm

Perfectly Explained, thanks a lot.

**

May 25, 2016 at 10:05 am

great for students looking job

oakley

May 29, 2016 at 4:47 am

I like the helpful info you provide in your articles. I will bookmark your weblog and check again here frequently. I am quite sure I will learn many new stuff right here! Best of luck for the next!

Shabeeh Hiader

June 5, 2016 at 7:35 am

it is very use useful for IT professional.

thanx
Vaibhav

rajan

June 5, 2016 at 9:25 am

Thanks

ray ban 3183

June 10, 2016 at 8:31 am

Definitely, what a splendid site and educative posts, I surely will bookmark your blog.Have an awsome day!

Neetu

June 18, 2016 at 3:19 am

nicely done, thanks these will surely help in my interview

ValeriSi

June 19, 2016 at 1:12 pm

informative

prohibicion de rayos

June 26, 2016 at 5:44 pm

I have not checked in here for some time since I thought it was getting boring, but the last few posts are good quality so I guess Iˇll add you back to my everyday bloglist. You deserve it friend 🙂

praveeen

July 2, 2016 at 4:45 am

Valuable information thanks for sharing

Anonymous

July 3, 2016 at 7:26 pm

good

nancy

July 10, 2016 at 7:22 pm

Thanks for blog it really helped me alot

manish

August 10, 2016 at 1:54 am

good one helpingtesters

bas

August 11, 2016 at 4:05 pm

You have brought up a very good details , appreciate it for the post.

Upasana

August 15, 2016 at 5:35 am

Good

bastcilkdoptb

August 17, 2016 at 7:25 pm

Very well written story. It will be supportive to anyone who utilizes it, as well as me. Keep doing what you are doing – can’r wait to read more posts.

Rajdeep Singh

September 4, 2016 at 9:30 am

Superb Article

Gaurav

September 7, 2016 at 8:29 am

Good

Harish

September 11, 2016 at 7:10 pm

In how much time can I learn Selenium?

Namit Tripati

September 15, 2016 at 3:24 am

Thanks

Anonymous

September 26, 2016 at 6:54 pm

One of our visitors recently encouraged the following website.

Ankit

September 27, 2016 at 2:59 pm

Interesting

Tessa

September 28, 2016 at 11:55 pm

Usually posts some very interesting stuff like this. If you’re new to this site.

Ratan

October 3, 2016 at 7:19 pm

Great Work !!! True End-To-End Testing !!!

Mohit

October 10, 2016 at 2:34 pm

Thanks great job…much informative!

Loraine

October 14, 2016 at 2:47 pm

Thank you for the information.

Ankit

October 23, 2016 at 5:53 pm

Hi Vaibhav and team, really its is a good work. Doing good work keep it up….

Alisa

October 26, 2016 at 12:25 pm

Glad to read & great revise start, practise & to become expert in ST…..
Thanks a lot

Nitin

October 27, 2016 at 11:37 am

Great work

Very helpful for freshers

Ashok Kumar

October 29, 2016 at 5:33 am

I just want to say I'm all new to weblog and truly liked you're website. More than likely I’m want to bookmark your website . You definitely have awesome posts. Appreciate it for revealing your website.

Archana

November 4, 2016 at 9:05 am

Good one

eebes

November 27, 2016 at 1:30 am

"It is perfect time to make some plans for the future and it is time to be happy. I've read this post and if I could I desire to suggest you few interesting things or tips. Maybe you could write next articles referring to this article. I wish to read even more things about it!"

Avanish

November 28, 2016 at 7:05 am

very useful to me thank u very much……………

Vikas Arora

November 28, 2016 at 7:22 am

Very good article

Ajay

November 28, 2016 at 7:34 am

this article is very good.thanks for sharing.

Lucky

November 28, 2016 at 7:50 am

Very helpful. Looking forward to see next article.
Thank you

Elizo

November 28, 2016 at 7:51 am

Very helpful. Looking forward to see next article.
Thank you

Pradeep Goswami

November 28, 2016 at 8:08 am

Good job !
Thank you !

Anita Garg

November 28, 2016 at 8:22 am

Highly useful links…thanks so much for your active contribution in helping testers worldwide…

edi

November 28, 2016 at 8:41 am

Highly useful links…thanks so much for your active contribution in helping testers worldwide…

Abdul

November 29, 2016 at 12:52 am

Please selenium selenium course details.

Deepak

November 29, 2016 at 1:09 am

I am a fresher,Completed Manual testing course and now learning selenium,so can any one help me what are the most important things that i have to learn now,and what type of questions will be asked if i go to interviews.

Please if any one nows tell me and help.

omni

November 29, 2016 at 6:50 pm

Thanks-a-mundo for the blog article. Want more.

Deepak

December 19, 2016 at 3:45 am

that’s a nice way to make understood any beginners those are new to software testing.

Thanks !!

Dani

December 20, 2016 at 4:19 pm

Thanks ,nice article it clears basics of test case writing

Chetan Arya

December 20, 2016 at 6:10 pm

Very Nice article on test cases basics

Afroz Khan

December 21, 2016 at 12:32 am

Thanks this is a very informative article.

Trapti

December 21, 2016 at 3:23 am

Thanks. It’s very useful!

Himanshu

December 21, 2016 at 5:18 am

Really a good topic for tester. Every tester should aware of this.

Anand Chand

December 21, 2016 at 11:40 am

Thanks. Very useful information.

Bilal

December 21, 2016 at 2:40 pm

Good info… Thanks 🙂

Priya Goel

December 21, 2016 at 4:37 pm

thanks.

Pratibha T

December 21, 2016 at 5:10 pm

Thanks. Very useful information.

Kunal

December 21, 2016 at 6:33 pm

big help!

Surabhi Sharma

December 22, 2016 at 1:11 am

I am seriously intrested in learning QA testing the best way. Please any advise. Thanks.

Sami

December 22, 2016 at 1:26 am

Thank you very much

Vicky

December 22, 2016 at 3:23 am

This is very amazing one…..:-)

Nishant Verma

December 22, 2016 at 11:53 am

This article is really helpful. Thank you for sharing this.

Rekha

December 22, 2016 at 2:20 pm

Hi..can u pls mail me manual testing notes with real time project ( test cases test plan..scenarios.. Srs doc example..) And also coding for selenium webdriver..

Madhuri

December 22, 2016 at 2:49 pm

Fabulous Example.

Soni Gupta

December 22, 2016 at 3:26 pm

Thank you sir its very helpful and you’re doing great job for us thanks once again

Rose acheter

December 22, 2016 at 7:18 pm

Great work Vaibhav…

Thanx & Best luck for future…

Suchit

December 22, 2016 at 10:04 pm

Really a very good job!!
Keep it up 🙂

Mamta

December 23, 2016 at 2:34 am

Nice article its very useful.

 

thanks

Mamta

Ritesh

December 23, 2016 at 3:08 am

Excellent great stuff.. Really helpful.. Looking forward for rest of… Thanks team…!!!!…..

Venkatesh

December 23, 2016 at 3:40 am

This is really great job, thank you for helping us.

Mayank

December 23, 2016 at 3:45 am

Just brilliant work..Will be waiting

chaussure

December 23, 2016 at 5:47 am

Got to learn a lot. 

Vaibhav

December 23, 2016 at 9:58 am

Thanks a lot !! Wonderful job !!!

Asif

December 23, 2016 at 1:38 pm

Its a brilliant work, nice start up and wish you good luck for your better future.hope you come out with best results.

Abhinav

December 23, 2016 at 5:07 pm

Very nicely done very and helpful!!!

Ratan Singh

December 23, 2016 at 9:36 pm

please let me know openings for manual tester in Gurgaon

dunk

December 23, 2016 at 9:41 pm

very usefull..!!!!!!!!!!!
Thanksss…

Anu

December 24, 2016 at 6:09 pm

very useful for freshers…

Ishwarya

February 23, 2017 at 5:40 pm

Great article, thanks a lot for sharing a valuable article on interview questions.
Please keep sharing such more articles.

Thanks a lot.

software testing

January 7, 2019 at 7:02 am

Hello ,
All the interview questions are really useful. Your blog just made me prepared for interview session.

Leave a Reply

Your email address will not be published.