Random Posts

Powered by Blogger.

What is Selenium

Selenium Interview Questions

Circle Gallery

Shooting

Racing

" });

Bottom

Selenium Tutorial for Beginner | Selenium Data Driven Testing using Excel | Selenium Tutorial Part 9 | Selenium Webdriver Tutorial @Dataprovider: In order to store the multiple set of Input data we use @Dataprovider. We are going to read the xls file which contains input data and store in @dataprovider Step to Achieve: ------------------------------- a. Store the input data in an xls file. - done b. Read the data from the xls using an third party jar jx12.6.jar c. Store the data in @Dataprovider d. Use the @Dataprovider in the @Test methods
Top 100 Selenium Interview Questions and Answers PDF






Q. How to handle frame in Webdriver?
Ans:

  • Select iframe by id: driver.switchTo().frame(*ID of the frame*);
  • Locating iframe using tagName;driver.switchTo().frame(driver.findElements(By.tagName(*iframe*).ger(0));
  • Locating iframe using index driver.switchTo().frame(0);
  • frame(Name of Frame);driver.switchTo().frame(*name of the frame*);
  • Select Parent window:driver.switchTo().defaultContent();

Q. How can we handle web based pop up?
Ans: 

  • Alert alert = driver.switchTo().alert();
  • alert.accept();
Q. Explain using Webdriver how you can perform double click?

Syntax:

  • Actions act = new Actions(driver);
  • act.doubleClick(webelement);
Q. When we can use Actions class in Selenium Webdriver test case?

  • Drag and drop element
  • Drag and drop by X,Y pixel offset
  • Selecting JQuesry selectable Items
  • Moving JQuery slider
  • Re-sizing JQuery re-sizable element 
  • Selecting date from JQuery date picker
Q. Five web driver common exceptions which you faced during test case execution?

  • Timeout Exception : This exception will be thrown when command execution does not complete in given time
  • NoSuchElement Exception : Webdrvier will throw this exception when element could not be found on page 
  • ElementNotSelectableException : It will be thrown when webdriver is trying to select unselectable element
  • ElemtnNotVisible Exception : Thrown when webdriver is not able to INTERNET with element which is available in DOM but is is hidden 

Q. What are the different types of locator's in Selenium?
Ans:

  1. ID
  2. ClassName
  3. Name
  4. TagName
  5. LinkText
  6. PartialLinkText
  7. Xpath
  8. CSS Selector

Q. When do we use findElement() and findElements()?
Ans:
  • findElement(): findElement()is used to find the first element in the current web page matching to the specified loctor value.
          Syntax: WebElement element = driver.findElements(By.xpath(*//div[@id='example']//ul//li*));



  • findElements();findElements() is used to find all the elements in the current web page matching to the specified loctor value

      Syntax: List<WebElament> elementList = driver.findElements(By.xpath(*//div[@id='example']//ul//li*)):

Q. What is the difference between driver.close() and driver.quit command?
Ans:

  •  close(): Webdriver's close() method closes the web browser window that the user is currently working on or we can also say the window that is being currently accessed by the webdriver. The command neither requires any parameter nor does is return any value 


  •  quit(): Unlike close() method, quit() method closes down all the windows that the program has opened. Same as close() method, the command neither requires any parameter nor does is return any value 

Q. What is Difference between getAttribute() and getText()?

Ans: 
  • getAttribute() method is useful to read element's attribute value like id, name, type etc.
  • getText() method Is useful to read text from element or alert.


Q. Which Operating systems support Selenium Webdriver?

Ans:
1. Windows - Windows XP, Windows7, Windows8 and Windows8.1
2. Apple OS X
3. Linux - Ubuntu.Other versions of Linux should support too

Q. What programming language supported by Webdriver? What language you have worked in your previous project?

Ans:

  1.  java
  2.  C#
  3.  PHP
  4.  Pearl
  5.  Ruby
  6.  Python

Q. What are the different types of drivers available in Webdriver?
Ans:
  1. FirefoxDriver
  2. InternetExplorerDriver
  3. Chromedriver
  4. Safaridriver
  5. OperaDriver
  6. AndroidDriver
  7. IphoneDriver
  8. HtmlUnitDriver

Q. Which web driver implementation is fastest?

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


Selenium Interview Questions and Answers 

Q.What are the benefits of automation testing.?
  1. Fast Test Execution 
  2. Re-usability of Test Cases
  3. Better Test Coverage In Each Version Release 
  4. Testing Cost Reduction
  5. RoI
Q. What are the few scenarios which we can not automate in selenium web-driver?

  1. Bitmap comparison is not possible using selenium webdriver
  2. Automating captcha is not possible 
  3. We can not read bar code using selenium Webdriver
For more Clarification watch the below video





What is Selenium : Selenium is a free (open source) automated testing suite for web applications across different browser and platforms. It is quite similar to HP Quick Test pro (QTP) Only that selenium focuses on automating web based applications.
Selenium is not just single tool bit a suite of software, each catering to to different testing needs of an organization.
It has four components:
► Selenium Integrated Development Environment (IDE)
► selenium Remote Control (RC)
►Selenium Webdriver
► Selenium Grid