Selenium Interview Questions

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What is the assertion in Selenium?

Assertion is used as a verification point. It verifies that the state of the application conforms to what is expected. The types of assertion are "assert" , "verify" and "waitFor".

Explain the difference between Selenium 1.0 and Selenium 2.0.

Image explanation

Name the three types of Selenese.

Three types of Selenese are: Actions: It is used for performing the operations and interactions with the target elements. Assertions: It is used as a check points. Accessors: It is used for storing the values in a variable.

How will you use Selenium to upload a file?

You can use "type"command to type in a file input box of upload file. Then, you have to use "Robot" class in JAVA to make file upload work

Using web driver how you can store a value which is text box?

You can use following command to store a value which is text box using web driver driver.findElement(By.id("your Textbox")).sendKeys("your keyword");

What is automation testing?

Automation testing is the process of using tools, scripts, and software to perform test cases by repeating pre-defined actions.

List out different types of locators?

Different types of locators are By.id() By.name() By.tagName() By.className() By.linkText() By.partialLinkText() By.xpath By.cssSelector()

Does Selenium have limitations? If so, what are some of these limitations?

Following are the limitations of Selenium: Selenium supports testing of only web-based applications Mobile applications cannot be tested using Selenium Captcha and Barcode readers cannot be tested using Selenium Reports can only be generated using third-party tools like TestNG or JUnit. As Selenium is a free tool, thus there is no ready vendor support through the user can find numerous helping communities. The user is expected to possess prior programming language knowledge.

Which web driver implementation is the fastest?

HTMLUnit Driver implementation is fastest, HTMLUnitDriver does not execute tests on browser but plain http request, which is far quick than launching a browser and executing tests

What is a locator? Name the different types of locators in Selenium.

Locators provide a way to access the HTML elements from a web page. In Selenium, we can use locators to perform actions on the text boxes, links, checkboxes and other web elements. Different types of locators are By.id() By.name() By.tagName() By.className() By.linkText() By.partialLinkText() By.xpath By.cssSelector()

While injecting capabilities in WebDriver to perform tests on a browser that is not supported by a WebDriver what is the limitation that one can come across?

Major limitation of injecting capabilities is that "findElement" command may not work as expected.

What is an Object Repository? How is it created in Selenium?

Object Repository is a term used to refer to the collection of web elements belonging to Application Under Test (AUT) along with their locator values. Thus, whenever the element is required within the script, the locator value can be populated from the Object Repository. Object Repository is used to store locators in a centralized location instead of hardcoding them within the scripts. In Selenium, objects can be stored in an excel sheet which can be populated inside the script whenever required or using page object model approach.

What is Selenese?

Selenese is the language which is used to write test scripts in Selenium IDE. Selenese is a selenium set of command which are used for running the test.

What are the two types of waits available in WebDriver?

Selenium WebDriver provides two types of waits - implicit wait and explicit wait.

Why is Selenium a choice tool for automation testing?

Selenium a choice tool for automation testing because it: 1. is a free and open source 2. have a large user base and helping communities 3. have cross Browser compatibility (Firefox, Chrome, Internet Explorer, Safari etc.) 4. have great platform compatibility (Windows, Mac OS, Linux etc.) 5. supports multiple programming languages (Java, C#, Ruby, Python, Pearl etc.) 6. has fresh and regular repository developments 7. supports distributed testing using Selenium Grid

Define Selenium.

Selenium is a free (open-source) automated testing framework used to validate web applications across different browsers and platforms. You can use multiple programming languages like Java, C#, Python etc. to create Selenium Test Scripts. Testing done using the Selenium tool is usually referred to as Selenium Testing.

What types of testing are supported by Selenium?

Selenium supports the following types of testing: Functional Testing Regression Testing

How can you use Selenium to identify an object?

Selenium uses a concept of 'Locators' for identifying objects. The findElement method in Selenium can be used to identify the elements. It takes a locator or a query object 'By' object and returns an object of type Web Element. 'By' object can be used with the various locator strategies available.

What is the difference between single slash (/) and a double slash (//) in Xpath?

Single slash ( / ) start selection from the document node It allows you to create 'absolute' path expressions Double slash ( // ) start selection matching anywhere in the document It enables to create 'relative' path expressions

Name some popular tools for automation testing.

Some popular tools for automation testing are Selenium, Katalon Studio, TestComplete, SoapUI.

What are Start points and Breakpoints in Selenium?

Startpoints: Startpoint indicates the point from where the execution should begin. Startpoint can be used when you want to run the testscript from the middle of the code or a breakpoint. Breakpoints: When you implement a breakpoint in your code, the execution will stop right there. This helps you to verify that your code is working as expected.

Mention 5 different exceptions you had in the Selenium web driver?

The 5 different exceptions you had in Selenium web drivers are - WebDriverException - NoAlertPresentException - NoSuchWindowException - NoSuchElementException - TimeoutException

List the advantages of WebDriver over Selenium Server?

The advantage of using WebDriver over Selenium Server are follows: · If you are using Selenium-WebDriver, you don't need the Selenium Server as it is using totally different technology · Selenium Server provides Selenium RC functionality which is used for Selenium 1.0 backwards compatibility · Selenium Web driver makes direct calls to browser using each browser native support for automation, while Selenium RC requires selenium server to inject JavaScript into the browser.

What are the Selenium suite components?

There are four components of Selenium - Selenium IDE, RC, WebDriver, and Grid.

Explain how you can find broken images in a page using Selenium Web driver?

To find the broken images in a page using Selenium web driver is - Get XPath and get all the links in the page using tag name - In the page click on each and every link - Look for 404/500 in the target page title

Explain how you can handle colors in web driver?

To handle colors in web driver you can use Use getCssValue(arg0) function to get the colors by sending 'color' string as an argument

Explain how you can switch back from a frame?

To switch back from a frame use method defaultContent() Syntax-driver.switchTo().defaultContent();

Explain how you can switch between frames?

To switch between frames webdrivers [ driver.switchTo().frame() ] method takes one of the three possible arguments - A number: It selects the number by its (zero-based) index - A name or ID: Select a frame by its name or ID Previously found WebElement: Using its previously located WebElement select a frame

Mention what are the capabilities of Selenium WebDriver or Selenium 2.0?

WebDriver should be used when requiring improvement support for - Handling multiple frames, pop ups , multiple browser windows and alerts - Page navigation and drag & drop - Ajax based UI elements - Multi browser testing including improved functionality for browser not well supported by Selenium 1.0

What is XPath?

X-Path is used to find the WebElement in web pages. It is also useful in identifying the dynamic elements.

Explain using WebDriver how you can perform double click?

You can perform double click by using Syntax- Actions act = new Actions (driver); act.doubleClick(webelement);

Where can you use Selenium Grid?

You should use Selenium Grid when you want to do either one or both of following: · Run your tests against different browsers, operating systems, and machines all at the same time. · Save time in the execution of your test suites. If you set up Selenium Grid to run, say, 4 tests at a time, then you would be able to finish the whole suite around 4 times faster.


Kaugnay na mga set ng pag-aaral

Finance - Capital Budgeting Techniques

View Set

Psychology Ch's 13-16 Final Exam S2

View Set

BIOL 65 Lecture Exam II - (REVIEW)

View Set

Pathways to Success High School Review

View Set

: The Ankle and Lower Leg joints

View Set

Ch. 4 The Tissue Level of Organization (Orion)

View Set