Posts

Selenium Grid with Docker

What is Selenium Grid? Selenium Grid is a part of Selenium component which supports Distributed test execution and it will let us run our tests on Multiple Operating systems against different browsers simultaneously. Traditional Selenium grid steps are, 1.Start Hub and connect all the nodes to it using below commands      Hub : java -jar selenium-server-standalone-3.xx.x.jar -role hub      Node1 : java -jar selenium-server-standalone-3.xx.x.jar -role node -hub              http://<systemip>:4444/grid/register -port 5556 -browser browserName=firefox      Node2 : java -jar selenium-server-standalone-3.xx.x.jar -role node -hub              http://<systemip>:4444/grid/register -port 5557 -browser browserName=chrome 2.Define the Desired capability to identify the OS platform and OS browser for execution     DesiredCapabilities desCap = null;     if(browser.equals("firefox")){         desCap=DesiredCapabilities.firefox();         desCap.setBrowserNa

Useful Design Patterns in Selenium Webdriver script

In this blog, we are going to discuss about different test design patterns and which one do we need to adhere while writing the Selenium webdriver test scripts. The most popular design patterns in Selenium are, 1) Singleton Pattern 2) Page object model First we will look into the question - What is Design Pattern?                  Design Pattern is the Programmer follows the good practices while writing program for the application or product to resolve/rectify the commonly occurring issues. In other words, It is a kind of strategy having structured program approach towards to show interactions and relationships between Classes and Objects. We have different kinds of Design patterns with its own Pros and Cons. The Design pattern types are, Creational Pattern - Practice of initiating the class object without using new operator for Object initiation. Structural Pattern - Practice of implementing inheritance in between Class, Object and interface to achieve new functionali

Selenium script execution into Continuous Integration Process

                 Most of the people end up saying of integrating the Selenium Test suite with any one of the Continuous Integration server (Jenkins, Bamboo,..etc) to trigger the execution after build deployment. The suite may be Sanity, Smoke or Regression Test suite. But here challenging part is the CI tools mostly run on Linux box and we may not have expected browser installed in it. I have listed some solutions for CI, 1) Change the Selenium test suite browser configuration and execute it using HtmlUnitdriver or PhantomJSDriver ( Headless execution)        The importance of having “headless” tests is:     a) The majority of Linux server and Windows Core Servers deployments doesn’t have GUI at all     b) To avoid opening the browser in the foreground during the build agent is being used for desktop applications testing which require focus  Execute the Automation Test suite using HtmlUnitdriver by making a simple change in the test    script browser configuration and com

Selenium Webdriver Interview Questions with Answer

1. Selenium doesn't support __________ to write programs (Test Scripts) a) Java b) Perl c) VBScript d) Python 2. __________ is an Advantage of Selenium WebDriver? a) Supports Web based Applications only b) No built-in Result Reporting facility c) Open Source d) No IDE 3. In webdriver, which methods navigates to a URL? a) goToUrl("url") b) navigate.to("url") c) getUrl("url") d) get("url") 4. Which of the following is the correct ‘Webdriver’ command to “delete all cookies in the browser”? a) Driver.deleteAllCookies() b) Driver.manage().deleteCookies() c) Driver.manage().deleteAllCookies() d) Driver.deleteCookies() 5. In webdriver, which of the following is a valid select statement that selects a value from a dropdown element? a) All of the listed options b) selectByIndex() c) selectByValue() d) selectByVisibleText() 6. In webdriver, selectAllOptions() is a valid command. a) True b) False 7. In webdriver, whic

Selenium IDE Interview Questions with Answer

1. Identify the invalid options about Selenium IDE a) It is a Firefox add-on and by using selenium IDE user can record and playback test cases in Firefox browser b) Tester can export the test cases from selenium IDE in Java Language only c) Tester can insert breakpoints in IDE d) Selenium IDE scripts can be executed on other browsers (IE, Chrome, Safari) 2. ________ doesn't support programming. a) Selenium IDE b) Selenium RC c) Selenium WebDriver d) Selenium Grid 3. ___________ is the built-in feature of Mozilla Firefox Browser to inspect elements? a) Firebug b) Firepath c) Page Inspector d) POM (Page Object Model) 4. Which of the following functionality is not supported by Selenium IDE? a) Database Testing b) Conditional statement c) All of the listed options d) Error Handling 5. Which selenium command check whether specific text exists somewhere on the page ? a) verifyTextPresent b) verifyTextPresent c) CheckTextPresent d) VerifyPresentText 6. Whic