div.menu4 { /*width:500px;margin:0 auto;*//*Uncomment this line to make the menu center-aligned.*/ text-align:center; font-size:0; height: 25px; *position:relative;*top:1px;/*Hacks for IE6 & IE7 */ } div.menu4 a { display: inline-block; margin-right:6px; /* It specifies the distance between each tab */ background:#FFF url(bg.gif) repeat-x 0 0; padding-left:4px; vertical-align:top;/*ChangeSet#1*/ text-decoration:none; } div.menu4 a span { display: inline-block; background:#FFF url(bg.gif) repeat-x 100% 0; padding: 0 20px; text-decoration:none; font: normal 12px Arial; line-height: 25px; color:#7087A9; vertical-align:top; } div.menu4 a:hover, div.menu4 a.current { background:#FFF url(bg.gif) repeat-x 0 -25px; line-height: 26px; } div.menu4 a:hover span, div.menu4 a.current span { background:#FFF url(bg.gif) repeat-x 100% -25px; line-height: 26px; color:#244D8A; } div.menu4sub { height:8px; border:1px solid #C2D5EF; background:#eee url(bg.gif) repeat-x 0 -50px; }

Friday 4 March 2016

20 Most Popularly Asked Selenium Interview Questions and Answers – Selenium Tutorial

Q1) What's Automation Testing?

Test Automation or Automation testing is a procedure for automating the manual procedure to check the program/system under evaluation. Automation testing does not need any guide intervention and includes use to another testing tool which enables you to create test scripts which may be executed frequently.

Q2) What would be the advantages of Automation Testing?

Advantages of Automation testing are:
  1. Supports performance of test cases that are continued
  2. In testing a big evaluation matrix hiv/AIDS
  3. Empowers concurrent execution
  4. Supports unattended execution
  5. Enhances precision thus reducing human created malfunctions
  6. Saves cash and time


Q3) Why should Selenium be chosen as a test program?

Selenium
  1. Is open as well as free source
  2. Have a big user base and communities that are supporting
  3. have Cross-Browser compatibility (Firefox, chrome, Ie, Safari etc.)
  4. have excellent platform compatibility (Windows, Macos, Linux etc.)
  5. supports several programming languages (Java, C#, Ruby, Python, Pearl etc.)
  6. Has routine and clean repository developments
  7. Supports testing that is dispersed


Q4) What is Selenium? Do you know the Selenium parts that are different?

Selenium is among the automated testing packages that are most popular. Inspire and selenium was made in a way to to guide automation testing of practical areas of internet based programs as well as an extensive array of platforms and browsers. 

As a result of its being in the open-source community, it's become among the very applications that are recognized amongst the screening specialists.

Selenium is not only a utility or one application, instead a program of several screening resources as well as for exactly the same reason it's called a Package. All the programs is designed to cater evaluation environment conditions and distinct testing.

The suite program makes up of these sets of resources:

  • Selenium Integrated Development Environment (IDE) - Selenium IDE is a a playback and record device. It's distributed as a Firefox Plug-In.
  • Selenium Remote-Control (RC) - Selenium RC is a host that enables user to produce test scripts in a programming language that is desirable. In addition, it enables running test scripts inside the big spectrum of browsers.
  • Selenium WebDriver - WebDriver is not the same tool completely that h-AS numerous advantages over Selenium RC. WebDriver utilizes its indigenous compatibility to automate and immediately communicates using the browser.
  • Selenium Grid - Selenium Grid is used to dole out your evaluation execution on environments and multiple systems concurrently.


Q5) What will be the testing kinds that may be supported by Selenium?

Selenium supports these kinds of testing:
  • Practical Testing
  • Regression Testing


Q6) What would be the limits of Selenium?

Following are the limits of Selenium:
  1. Selenium supports screening of internet that is only programs that are based
  2. Mobile software are unable to be analyzed using Selenium
  3. Bar and Captcha code readers are unable to be analyzed using Selenium
  4. Reports can only be created using third party software like Junit or TestNG.
  5. As Selenium is a totally free program, so there's absolutely no prepared seller support although user can locate numerous communities that are supporting.
  6. User is likely to possess previous programming language information.


Q7) When can I use Selenium IDE?

Selenium IDE is easiest and the most straightforward of all programs inside the Selenium Program. Play back feature and its record makes it extremely simple to understand to any programing language with minimum acquaintances. Selenium IDE is a great tool to get a user that is innocent.

Q8) What's Selenese?

Selenese is the language that will be used to to create test scripts in Selenium IDE.

Q9) What would be the various kinds of locators in Selenium?

Locator could be referred to as as a tackle that identifies a net component distinctively inside the web page. Therefore, to identify net components correctly and just we've got various kinds of locators in Selenium:
  1. ID
  2. ClassName
  3. Name
  4. TagName
  5. LinkText
  6. PartialLinkText
  7. Xpath
  8. CSS Selector
  9. DOM


Q10) What's difference between claim and confirm commands?

Claim: Maintain command tests whether the specified state is untrue or true. Let us say we declare not or whether the specified component exists on the website. In the event the situation is true then another evaluation measure will be executed by the software management however, if the status is false, the execution would cease and no additional evaluation could be ran.

Check: Check command additionally checks whether the specified state is untrue or true. Irrespective of the state being true or untrue, the application execution does not stops i.e. any failure during confirmation wouldn't halt the execution and all the evaluation measures would be performed.

Q11) What's an Xpath?

Xpath can be used to choose a net component according to its XML route. Transport, arrange and xML means Extensible Mark-Up Language and is utilized to save information. It stores information in a key-value pair that will be extremely just like HTML tags. Both being mark-up languages and Xpath may be used to find HTML components, because they come under below the exact same umbrella.

The behind finding components essential Xpath is the traversing between different components therefore and over the whole page enabling a person to locate a component together with the reference of some other component.

Q12) What's the dissimilarity between "/" and "//" in Xpath?

Single Slash "/" - Single slash is utilized to generate Xpath with complete path i.e. the xpath would be created to begin pick from the doc node/beginning node.

Double Slash "//" - Twice slash is utilized to generate Xpath with relative path i.e. the xpath would be created to begin pick from everywhere within the file.

Q13) What's Same origin policy and the way that it might be managed?

The problem of origin policy disallows to get the DOM of a file from an origin that differs from your source we're looking to gain access to the file.

Source is a serial mixture of host, system and port. As an example, to get a URL http:// http://www.softwaretestinghelp.com/sources/, the source is a mix of https, softwaretestinghelp.com, 80 correspondingly.

So the Selenium Core (Java Script System) cannot get the components from an origin that differs from where it had been found. For Instance. The other domain names like google.com, seleniumhq.org would no more be reachable.

Thus, to be able to take care of same origin coverage, Selenium Remote-Control was released.

Q14) When should I use Selenium Grid?

Selenium Grid can be utilized to perform different or same test scripts on browsers and several platforms concurrently in order to realize spread evaluation execution, preserving execution time unexpectedly and screening under different surroundings.

Q15) What do we imply by Selenium 1 and Selenium 2?

WebDriver and selenium RC, in a mixture are popularly called Selenium 2. Selenium RC alone is also referred as Selenium 1.

Q16) Which is the most recent Selenium program?

WebDriver

Q17) How do I start the browser utilizing WebDriver?
  1. This syntax may be used to establish Browser:
  2. WebDriver driver = new FirefoxDriver();
  3. WebDriver driver = new ChromeDriver();
  4. WebDriver driver = new InternetExplorerDriver();


Q18) What would be the various kinds of Drivers accessible WebDriver?

Different drivers accessible WebDriver are:
  1. FirefoxDriver
  2. InternetExplorerDriver
  3. ChromeDriver
  4. SafariDriver
  5. OperaDriver
  6. AndroidDriver
  7. IPhoneDriver
  8. HtmlUnitDriver


Q19) What would be the various kinds of waits accessible WebDriver?

There are two kinds of waits accessible WebDriver:
  1. Implied Delay
  2. Explicit Wait
  3. Implied Delay: Implied delays are used to supply a default waiting-time (say 30 seconds) between each successive evaluation measure/command over the whole test script. Therefore, following evaluation measure would simply do after running the last evaluation measure/command when the 30 seconds have elapsed.

Explicit Wait: Explicit waits are employed to prevent the execution the most time has elapsed or till the time a certain condition is satisfied. Unlike Implied delays, delays that were explicit are used to get a specific example just.

Q20) the Best Way To type in a text field using Selenium?

User can use sendKeys("String to be input") to input the string in the text entry box.

Syntax:
WebElement user-Name = drv.findElement(By.id("E-Mail"));
// inputting that is username
User name.sendKeys("sth");

No comments:

Post a Comment