Selenium Webdriver Interview Questions and Answers

Q1 --> What is Automation Testing?
Q2 --> What are the advantages of Automation Testing?
Q3 --> What is Selenium?
Q4 --> How many Selenium components?
Q5 --> Why should be selected Selenium as a test automation tool?
Q6 --> Which type of testing are supported by Selenium?
Q7 -->  What are the limitations of Selenium?
Q8 --> What is Selenium Webdriver?
Q9 --> What is the difference between Selenium IDE, Selenium RC and WebDriver?
Q10 --> Which Programming Languages Supported By Selenium WebDriver?
Answer:Selenium webdriver support many different languages to write test cases for your software web application. List of WebDriver supported languages are as bellow.
                                 Java
                                 C#
                                 Python
                                 Ruby
                                 Perl
                                 PHP
Q11 -->  How many drivers are supported by selenium webdriver for Browsers?
Answer: List of Webdriver browser drivers are as bellow.
    FirefoxDriver
      WebDriver driver = new FirefoxDriver();
    InternetExplorerDriver
              System.setProperty("webdriver.ie.driver""location/IEDriverServer.exe");
             WebDriver driver = new InternetExplorerDriver();
    ChromeDriver
       System.setProperty("webdriver.chrome.driver", "location/chromedriver.exe"); 
       WebDriver driver = new ChromeDriver(); 
    SafariDriver
       WebDriver dr = new SafariDriver();
    OperaDriver   
     DesiredCapabilities capabilities = DesiredCapabilities.opera(); 
     apabilities.setCapability("opera.binary", " Absolute Path of Opera browser "); 
     WebDriver dr = new OperaDriver(capabilities);
    HtmlUnitDriver
     WebDriver dr = new HtmlUnitDriver();   
 Q12 --> How many driver are available in selenium webdriver for mobile testing?
Answer: There are three driver in selenium webdriver for mobile testing.Selenium WebDriver supports bellow given drivers to test mobile application.
                                 AndroidDriver
                                 OperaMobileDriver
                                 IPhoneDriver
Q13 --> What type locators use in selenium webdriver?
The locators elements of Selenium Webdriver as run as following with java syntax and example.
Method: By ID
Syntax: driver.findElement(By.id(<element ID>))
Description: Locates an element using the ID attribute. The most efficient way and preferred way to locate an element on a web page is By ID. ID will be the unique on web page which can be easily identified. IDs are the safest and fastest locator option and should always be the first choice even when there are multiple choices, It is like an Employee Number or Account which will be unique.
Example:
<input type="text"  id="email" name="email" class="inputtext">
<div id="main_menu">Home.</div>


Selenium Webdriver write as:
WebElement loginemail= driver.findElement(By.id("email"));
String menuname= driver.findElement(By.id("main_menu")).getText();

driver.findElement(By.id("email")).sendKeys("abced@gmail.com");
Method: By class name
Syntax: driver.findElement(By.className(<element class>)), driver.findElements(By.className(<element class>))
Description: Locates an element using the Class attribute. There may be multiple elements with the same name. We use findElement() method for single element class name. We use findElements() for  multiple elements with the same name.
Example:
<input type="text"  id="email" name="email" class="inputtext">
<input type="password" id="pass" name="pass" class="inputtext">

or
<input name="register" class="required" type="text"/> 
<div class="mobile">8801911444444.</div>
Selenium Webdriver write as:
List<WebElement> noinputf = table.findElements(By.className("inputtext"));
or
WebElement loginemail= driver.findElement(By.className("required"));

WebElement loginemail= driver.findElement(By.className("mobile")).getText();;

7 comments:

  1. Check latest selenium interview questions at Modern Pathshala

    ReplyDelete

  2. It as a very interesting and then skilled blogger I have joined for this web page if teh your web page feed and look forward to seeking more of your great post
    Hadoop Training
    Hadoop Online Training

    ReplyDelete

  3. I’m not sure where you’re getting your information, but good topic. I need to spend some time learning more or understanding more. Thanks for fantastic info I was looking for this information for my mission.

    Selenium Training in Chennai

    ReplyDelete
  4. Thanks a lot for sharing the important interview questions.
    It is very helpful, definitely will use it as a reference for interviews.

    Selenium training in Chennai | Best Selenium training institute in Chennai

    ReplyDelete
  5. Selenium is Open Source - Functional Automation Tool, It supports most of the languages like Java, Perl, Python, Ruby, C#, PHP, Dot Net. It is also supports to all OS and all Browsers in the market. They are classified into four 1. Selenium IDE, 2.Selenium WebDriver, 3. Selenium RC (Remote Control), 4.Selenium Grid

    Note: Current requirement in industry is Selenium WebDriver (Version 2.0).
    Selenium Training in Chennai.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Thanks a lot for sharing the important interview questions.The blog you shared is very good. I expect more information from you like this blog. Thankyou.
    Selenium Training in chennai | Selenium Training in annanagar | Selenium Training in omr | Selenium Training in porur | Selenium Training in tambaram | Selenium Training in velachery

    ReplyDelete