• +91 9723535972
  • info@interviewmaterial.com

DevOps Interview Questions and Answers

DevOps Interview Questions and Answers

Question - 61 : - How can you access the text of a web element?

Answer - 61 : -

Get command is used to retrieve the text of a specified web element. The command does not return any parameter but returns a string value.

Used for:

  • Verification of messages
  • Labels
  • Errors displayed on the web page
Syntax: 

String Text=driver.findElement(By.id(“text”)).getText();

Question - 62 : - When do we use findElement() and findElements()?

Answer - 62 : -

A. findElement()

It finds the first element in the current web page that matches the specified locator value.

Syntax:

WebElement element=driver.findElements(By.xpath(“//div[@id=‘example’]//ul//li”));

B. findElements()

It finds all the elements in the current web page that matches the specified locator value.

Syntax:

List elementList=driver.findElements(By.xpath(“//div[@id=‘example’]//ul//li”));

Question - 63 : - What are driver.close() and driver.quit() in WebDriver?

Answer - 63 : -

These are two different methods used to close the browser session in Selenium WebDriver:

  • driver.close() - This is used to close the current browser window on which the focus is set. In this case, there is only one browser open.
  • driver.quit() - It closes all the browser windows and ends the WebDriver session using the driver.dispose method.

Question - 64 : -
How can you submit a form using Selenium?

Answer - 64 : -

The following lines of code will let you submit a form using Selenium:

WebElement el = driver.findElement(By.id(“ElementID”));

el.submit();

Question - 65 : - What are the Testing types supported by Selenium?

Answer - 65 : -

There are two types of testing that are primarily supported by Selenium:

Functional Testing - Individual testing of software functional points or features.

Regression Testing - Wherever a bug is fixed, a product is retested and this is called Regression Testing.

Question - 66 : - What is Selenium IDE?

Answer - 66 : -

Selenium integrated development environment (IDE)  is an all-in-one Selenium script development environment. It may be used to debug tests, alter and record and is also available as a Firefox extension. Selenium IDE comes with the whole Selenium Core that  allows us to rapidly and easily replay and record  tests in the exact environment where they will be conducted.

Selenium IDE is the best environment for building Selenium tests, regardless of the style of testing we prefer, thanks to the ability to move instructions around rapidly and the autocomplete support.

Question - 67 : - What is the difference between Assert and Verify commands in Selenium?

Answer - 67 : -

The difference between Verify and Assert commands in Selenium are:

  • The verify commands determine whether or not the provided condition is true. The program execution does not halt regardless of whether the condition is true or not, i.e., all test steps will be completed, and verification failure will not stop the execution.
  • The assert command determines whether a condition is false or true. To know whether the supplied element is on the page or not, we do the following. The next test step will be performed by the program control, if the condition is true. However, no further tests will be run, and the execution will halt, if the condition is false.

Question - 68 : - How to launch Browser using WebDriver?

Answer - 68 : -

To launch Browser using WebDriver, following syntax is followed -

WebDriver driver = new InternetExplorerDriver();

WebDriver driver = new ChromeDriver();

WebDriver driver = new FirefoxDriver();

Question - 69 : - Why are SSL certificates used in Chef?

Answer - 69 : -

SSL certificates are used between the Chef server and the client to ensure that each node has access to the right data.
Every node has a private and public key pair. The public key is stored at the Chef server.
When an SSL certificate is sent to the server, it will contain the private key of the node.
The server compares this against the public key in order to identify the node and give the node access to the required data.

Question - 70 : - What is Test Kitchen in Chef?

Answer - 70 : -

Test Kitchen is a command-line tool in Chef that spins up an instance and tests the cookbook on it before deploying it on the actual nodes.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners