Selenium Interview Questions and Answers
Q1. What is Selenium?
Ans: Selenium is one of the maximum famous computerized testing device used to automate numerous sorts of programs. Selenium is a package of several testing equipment designed in a way for to guide and encourage automation testing of practical components of internet-primarily based programs and a huge variety of browsers and structures and for the same reason, it's far called a Suite. Due to its life within the open supply network, it has turn out to be one of the maximum generic tools amongst the testing experts. It consists of three predominant elements: Selenium IDE, Selenium RC & Selenium Web Driver. Each of these tools is designed to cater one-of-a-kind checking out and take a look at surroundings necessities.
Q2. Where we use Selenium and why we use Selenium?
Ans: Selenium is used in Automation Testing. Selenium is surprisingly bendy Tool and is used to allowing more options for finding UI factors and comparing predicted take a look at results towards real software behavior and is also used to help for executing one’s tests on more than one browser systems.
Q3. Why Selenium is good tool for Automation Testing?
It is Free and open source
It helps allotted trying out
It has everyday repository traits
It has a massive user base and guide network
It has wide platform compatibility – Windows, Mac OS, and Linux, and so forth.
It has cross-browser compatibility – Internet Explorer, Chrome, Firefox, Safari, and many others.
It helps multiple programming languages – Java, C#, Ruby, Perl, Python, and so on.
Q4. What are the Selenium gear Components?
Ans: The Selenium tool package components are:
Selenium IDE (Integrated Development Environment)
Selenium Web motive force
Q5. What is supposed by means of Selenium IDE?
Ans: Selenium IDE (Integrated Development Environment) is a plug-in used to file and replay checks in Firefox browser. Scripts may be mechanically recorded and edited manually imparting automobile-completion aid and the potential to transport instructions around quickly.
Q6. When we can use Selenium IDE?
Ans: Selenium IDE is the simple and clean device of all of the Selenium Package Tools. It has record and playback feature make it tremendously easy to analyze with minimal friends to any programming language. Selenium IDE is a really perfect device for a naïve person.
Q7. What are the checking out types that may be supported by means of Selenium?
Ans: Selenium helps the following kinds of checking out’s:
Q8. What are the Disadvantages of Selenium?
Ans: Selenium supports trying out of best internet-based programs
Mobile packages can not be tested using Selenium
Captcha and Barcode readers can not be examined using Selenium
Reports can only be generated the usage of 1/3-celebration equipment like TestNG or JUnit.
As Selenium is a loose tool, for that reason there may be no equipped vendor support thru the consumer can discover severa helping groups?
The person is predicted to own prior programming language know-how.
Q9. How many varieties of selenium web driver APIs are to be had?
Ans: The list of motive force training may be used for the browser automation.
Event Firing Web Driver,
Html Unit Driver,
I Phone Driver,
I Phone Simulator Driver,
Remote Web Driver
Internet Explorer Driver
Q10. What are the one of a kind forms of locators in Selenium?
Ans: The locator can be termed as an deal with that identifies a web detail uniquely in the website. Thus, to pick out internet factors appropriately and precisely we've got specific kinds of locators in Selenium:
Partial Link Text
Q11. What is supposed by way of Selenese?
Ans: Selenese is the language that is used to write test scripts in Selenium IDE.
Q12. What are the Technical Challenges in Selenium?
Selenium helps simplest web based programs
It does not aid the Bitmap comparison
For any reporting associated talents must rely upon 1/3 party gear
No dealer assist for device in comparison to commercial equipment like HP UFT
As there's no item repository idea in Selenium, maintainability of objects will become difficult
Q13. What is meant with the aid of X Path in selenium?
Ans: X Path is used to locate a web detail primarily based on its XML route. XML stands for Extensible Markup Language and is used to keep, prepare and delivery arbitrary statistics. It shops statistics in a key-cost pair which is very a great deal just like HTML tags. The fundamental behind finding factors using X Path is the traversing among various factors throughout the complete page and as a consequence enabling a consumer to locate an detail with the reference of some other detail. Both being markup languages and considering they fall underneath the same umbrella, X Path can be used to locate HTML elements.
Q14. What is the difference between the “/” and “//” in X path?
Ans: Single Slash “/” – The Single cut down is used to create Xpath with absolute direction i.E. The xpath would be created to start choice from the file node/start node.
Double Slash “//” – The Double diminish is used to create Xpath with relative course i.E. The xpath would be created to begin selection from everywhere in the document.
Q15. When have to we use Selenium Grid?
Ans: Selenium Grid can be used to execute same or different take a look at scripts on multiple systems and browsers concurrently to be able to obtain allotted test execution, checking out under specific environments and saving execution time remarkably.
Q16. What can we suggest via Selenium 1 and Selenium 2?
Ans: Selenium RC and Web Driver, in a combination, are popularly called Selenium 2. Selenium RC on my own is likewise referred as Selenium
Q17. Which is the modern Selenium tool?
Q18. How do I release the browser using Web Driver?
Ans: The following syntax may be used to launch Browser:
WebDriver driver = new FirefoxDriver();
WebDriver motive force = new ChromeDriver();
Web Driver driving force = new Internet Explorer Driver();
Q19. What are the unique forms of Drivers to be had in Web Driver?
Ans: The different drivers available in WebDriver are:
Fire fox Driver
Internet Explorer Driver
Html Unit Driver
Q20. What are the distinctive styles of waits available in Web Driver?
Ans: There are varieties of waits available in Web Driver:
Implicit Wait: Implicit waits are used to offer a default waiting time (say 30 seconds) among every consecutive check step/command throughout the whole check script. Thus, subsequent test step might simplest execute whilst the 30 seconds have elapsed after executing the previous check step/command.
Explicit Wait: Explicit waits are used to halt the execution until the time a particular condition is met or the maximum time has elapsed. Unlike Implicit waits, explicit waits are implemented for a particular example only.