Check Selenium Interview questions from 1 to 10 below:
Check Selenium-SDET-UIAutomation Questions set 21 to 30:
Let's revise our understanding on Selenium first.
Webdriver:
WebDriver drives a browser natively, as a user would, either locally or on a remote machine using the Selenium server, marks a leap forward in terms of browser automation.
Selenium WebDriver refers to both the language bindings and the implementations of the individual browser control code. This is commonly referred to as just WebDriver and its not a class but an INTERFACE.
Selenium WebDriver is a W3C Recommendation
WebDriver is designed as a simple and more concise programming interface.
WebDriver is a compact object-oriented API.
It drives the browser effectively.
The latest release is Selenium 4.
71. How to check Text is Bold or not using selenium ?
WebElement text = driver.findElement(By.xpath("//*[contains(text(),'Automation')]"));
//Read font-weight property and print It In console.
String fontSize = text.getCssValue("font-weight");
System.out.println("Font color -> "+fontSize);
72. What is staleElementException, what are the causes and resolution for it?
Ans:
A StaleElementException is thrown when the element you were
Interaction is destroyed and then recreated. Most complex web pages
these days will move things about on the fly as the user interacts with
it and this requires elements in the DOM to be destroyed and recreated.Ans: driver.findElement(By.id(“id“)).getCssValue(“name of the css attribute”);
74. What is the Selenium's Recording language?
Ans: Selenium recording language is HTML
75. How to refresh browser without using navigate()?
Ans: Using sendKeys(Keys.F5)
76. What are the new features in Selenium 4? VERY IMP
77. What is the best way to resolve NoSuchElementException in Selenium?
Ans:
You can never be sure that element will be found, this is
purpose of functional tests - to tell you if anything changed on your
page. But one thing which definitely helps is to add waits for the
elements which are often causing NoSuchElementException
like
WebDriverWait wait = new WebDriverWait(webDriver, timeoutInSeconds);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id<locator>));
78.
What is page load strategy in Selenium?
Ans: Click Here For Answer In-Detail
79. What is the default time for implicit and explicit wait?
Implicit wait default time is zero.
Explicit wait default time is 500 ms
How to perform back,forward and refresh action in selenium?
- driver.navigate().back()
- driver.navigate().forward ()
- driver.navigate().refresh()
What is the return type of findelements?
List of elements with similar property
What will happen if no webelement is found for findelements?
It will return an empty list
What will happen if no webelement is found for findelement?
It will give error as :NoSuchElementException
80. Explain some of the keywords that have been used in your project for BDD approach?
Ans: Click Here For Answer With Example
81. What is TDD and BDD?
Test Driven Development (TDD)
Rather than a test type per se, TDD is an iterative development methodology in which tests drive the design of a feature.
Each cycle starts by creating a set of unit tests that the feature should eventually pass (they should fail their first time executed).
After this, development takes place to make the tests pass. The tests are executed again, starting another cycle and this process continues until all tests are passing.
This aims to speed up the development of an application based on the fact that defects are less costly the earlier they are found.
Behavior-driven development (BDD)
BDD is also an iterative development methodology based on the above TDD, in which the goal is to involve all the parties in the development of an application.
Each cycle starts by creating some specifications (which should fail). Then create the failing unit tests (which should also fail) and then do the development.
This cycle is repeated until all types of tests are passed.
In order to do so, a specification language is used. It should be understandable by all parties and simple, standard and explicit. Most tools use Gherkin as this language.
The goal is to be able to detect even more errors than TDD, by targeting potential acceptance errors too and make communication between parties smoother.
A set of tools are currently available to write the specifications and match them with code functions, such as Cucumber or SpecFlow.
A set of tools are built on top of Selenium to make this process even faster by directly transforming the BDD specifications into executable code. Some of these are JBehave, Capybara and Robot Framework.
***what does selenium do or what is selenium: Though we all know but remember it is not a tool, Selenium is an open source umbrella project for a range of tools and libraries aimed at supporting browser automation.
Revision:
49. Which Source code management tool you have used and tell me some of the basic commands that you have used?
50. Have you worked on database side for fetching data to validate in selenium tests, if Yes then can you tell me some of the basic queries that you have used in day to day work?
Click here for answer with 11 queries
36. How to launch batch file from Selenium WebDriver?
Process batch = Runtime.getRuntime.exec("path of the batch file");
37. How to run selenium test from command line?
java -classpath ".;selenium-server-standalone-2.33.0.jar" SampleClass
38. What is the name of the super interface of the Webdriver?
Ans: SearchContext.
39. Explain some of the strategy you have followed while using xpath?
40. How to execute the testng test suite from the command line?
Ans: java -cp “C:\AutomationReinvented\testng \lib\*;C:\AutomationReinvented\testng\bin” org.testng.TestNG testng.xml
*******************************************************************For any doubts or career guidance, arrange a 1:1 call with me
********************************************************************
Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session
*************************************************
SeleniumWebdriver Automation Testing Interview Questions:API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign
Java Related Interview Question Set
https://automationreinvented.blogspot.com/search/label/Java
GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT
Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
Mobile Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Mobile%20Testing
Python Interview Question Set for QAE - SDET - SDE:
https://automationreinvented.blogspot.com/search/label/Python
No comments:
Post a Comment