Selenium Frequently Asked Questions & Answers Part-6





Ques.126. How do you handle HTTP Proxy Authentication pop ups in browser?
Form authentications URL - http://UserName:Password@Example.com
Example:
http://the-internet.herokuapp.com/basic_auth
https://admin:admin@the-internet.herokuapp.com/basic_auth


Ques.127. How do you handle Ajax dropdowns?
With help of Selenium Sync commands like ImplicitWait, WebDriverWait or FluentWait.


Ques.128. What is the default port for Selenium Grid?
4444
  

Ques.129. How to run tests in multiple browser parallel?   
Using selenium grid

Ques.130. How to find broken images in a page using Selenium Web driver.

Get xpath and then using tag name 'a'; get all the links in the page
Use HttpURLConnector class and sent method GET
Get the response code for each link and verify if it is 404/500


List links = driver.findElements(By.tagName("a"));

for (int i = 0; i < links.size(); i++) {
WebElement element = links.get(i);

// By using "href" attribute, we could get the url of the requried link
String url = element.getAttribute("href");

//System.out.println(url);
URL link = new URL(url);

// Create a connection using URL object (i.e., link)
HttpURLConnection httpConn = (HttpURLConnection) link.openConnection();

// Set the timeout for 2 seconds
httpConn.setConnectTimeout(2000);

// connect using connect method
httpConn.connect();

// use getResponseCode() to get the response code.
if (httpConn.getResponseCode() >= 400) {
    System.out.println(url + " - " + "is Broken Link");
    } else {
        System.out.println(url + " - " + "is valid Link");
    }

Ques.131. How to disable cookies in browser?
Using deleteAllVisibleCookies() in selenium


Ques.132. How does u handle dynamic elements without using XPath?
By using classname or css.


Ques.133. Write down scenarios which we can't automate?

Barcode Reader, Captcha etc.


Ques.134. How do you manage the code versions in your project?
Using SVN, GitHub or other versioning tools


Ques.135. How to count total no of hyperlinks in a page?
Listalllinks=driver.finElements(By.tagname("a");
System.out.println(alllinks.size());


Ques.136. What are the benefits of Automation Testing?

Saves time and money. Automation testing is faster in execution.
Reusability of code. Create one time and execute multiple times with less or no maintenance.
Easy reporting. It generates automatic reports after test execution.
Easy for compatibility testing. It enables parallel execution in the combination of different OS and browser environments.
Low-cost maintenance. It is cheaper compared to manual testing in a long run.
It is mostly used for regression testing. Supports execution of repeated test cases.
Minimal manual intervention. Test scripts can be run unattended.
Maximum coverage. It helps to increase the test coverage.


Ques.137. What type of tests have you automated?
Our main focus is to automate test cases to do Regression testing, Smoke testing, and Sanity testing. Sometimes based on the project and the test time estimation, we do focus on End to End testing.


Ques.138. How many test cases you have automated per day?
It depends on Test case scenario complexity and length.
I did automate 2-5 test scenarios per day when the complexity is limited.
Sometimes just 1 or fewer test scenarios in a day when the complexity is high.


Ques.139. What is Selenium IDE?
Selenium IDE (Integrated Development Environment) is a Firefox plugin.
It is the simplest framework in the Selenium Suite.
It allows us to record and playback the scripts. Even though we can create scripts using Selenium IDE, we need to use Selenium WebDriver to write more advanced and robust test cases.

Ques.140. What is Selenese?
Selenese is the language which is used to write test scripts in Selenium IDE.


Ques.141. What is Selenium RC?
Selenium RC (Selenium 1).
Selenium RC was the main Selenium project for a long time before the WebDriver merge brought up Selenium 2.
Selenium 1 is still actively supported (in maintenance mode). It relies on JavaScript for automation. It supports Java, Javascript, Ruby, PHP, Python, Perl and C#. It supports almost every browser out there.


Ques.142. What is Selenium WebDriver?
Selenium WebDriver (Selenium 2) is a browser automation framework that accepts commands and sends them to a browser.
It is implemented through a browser-specific driver.
It controls the browser by directly communicating with it.
Selenium WebDriver supports Java, C#, PHP, Python, Perl, Ruby.

Ques.143. When do you use Selenium Grid?

Selenium Grid can be used to execute same or different test scripts on multiple platforms and browsers concurrently so as to achieve distributed test execution.


Ques.144. What are the advantages of Selenium Grid?
It allows running test cases in parallel thereby saving test execution time.
It allows multi-browser testing
It allows us to execute test cases on multi-platform


Ques.145. What is a hub in Selenium Grid?
A hub is a server or a central point that controls the test executions on different machines.


Ques.146. What is a node in Selenium Grid?

Node is the machine which is attached to the hub. There can be multiple nodes in Selenium Grid.


Ques.147. What are the types of WebDriver APIs available in Selenium?
Firefox Driver
InternetExplorer Driver
Chrome Driver
HTMLUNIT Driver
Opera Driver
Safari Driver
Android Driver
iPhone Driver


Ques.148. Which WebDriver implementation claims to be the fastest?
The fastest implementation of WebDriver is the HTMLUnitDriver. It is because the HTMLUnitDriver does not execute tests in the browser.


Ques.149. What are the Programming Languages supported by Selenium WebDiver?

Java
C#
Python
Ruby
Perl
PHP


Ques.150. What are the Operating Systems supported by Selenium WebDriver?
Windows
Linux
Mac

Followers