Selenium interview Q/A Part-1

Selenium interview questions


1.What is the meaning of Page object Model pattern?

2.What is the difference between data/keyword driven frameworks?

3.Difference between TestNG and Junit?

4.Major components of OOPS?

5.What are the new features in Java - 8?

6.Key components of white box testing?

7.Meaning of headless browser?

8.What is the advantages and disadvantages of headless browser testing?


10.Explain any of the challenging scenario while working with Selenium webdriver

Hints:-
1.Page object model is a design pattern which separates "What we need to test" and "How we are going to test it".This provides readable, easy to maintain and reduces duplicate code. Corresponding classes are created for each page, with UI webelements properties and methods.

2.Data drives the test cases, example testing gmail login with 10 set of username.Keyword driven, english like keywords are created which defines the actions that user need to perform on application. Example open browser, login to gmail.

4.
  • Object - entity with state and behaviour example laptop, pen
  • Class - blueprint for object, call it collections of objects with members(state) and methods(behaviour)
  • Inheritance - child(sub class) inherits from parent(super class), provides code resuablity.Class A extends Class B.
  • Polymorphism - many form of the same function Types: method overloading+ method overriding.
  • Abstraction - hiding the implementaiton details - interface or abstarct class
  • Encapsulation - objects encapsulate their state and hide it from the outside using private, protected, public and default.
5.Date/Time API improvements, default method in interface, lambda expressions, javascript engine.

6.Unit and Integration testing. Diving deep into code to perform testing.
7.Browser without having any UI. Drivers like HTMLUnit, PhantomJs
8.Advantage - Faster,platform independent.Disadvantages:-Difficult to pin point errors say on page loading, ajax calls.

API testing interview Questions-1 ?

api TESTING interview Questions


Do follow us for more updates on  Fb,G+,Twitter.

Basic API Testing interview questions:-

1.What is the meaning of HTTP protocol?

2.What are the range of methods available in HTTP?

3.What is the difference between PUT and POST method?

4.What are the different  HTTP status codes?

5.Why we use 5XX error code?

6.How we can filter the Head of the response?

7.What is the difference between UI and API testing tools?

8.How to test code coverage using API testing?

9.How we can implement reporting structure in Soap UI(Free version)

10.Range of tools that can we used to test API?

Hints:-

1.HTTP (Hypertext Transfer Protocol) provides a network protocol standard that Web browsers and servers use to communicate.Both SOAP and Rest API internally uses HTTP.
2.GET,POST,PUT,DELETE,HEAD,OPTIONS,CONNECT,TRACE
4. 1xx- information error, 2xx-Success, 3xx-Redirection,,4xx-Client Error(most common is page not found,401-bad request),5xx-Server Error
6.By using HEAD method :)
9.By using Groovy scripting and making our hands dirty with creating a robust framework for reporting.
10.SOAP UI(Soap,Rest), Robot Framework(Rest) , Postman(chrome plugin, mostly used by developers ), HP UFT



Working with REST API using Robot Framework?

Scenario:- How we can automate API calls using Robot Framework?
Robot framework call in Rest API

Solution:-
We can utilize the methods from below 2 libraries:-




We tested the second library in our application, just install the library and we are ready to go.



How to call Javascript/VBS functions in Robot Framework.

Scenario:-How we can call javascript/vbs functions in Robot Framework?
Solution:- 
VBS:-
Using the python function to call the VBS file.
VBS function in robot framework




Javascript:-
Using the inbuilt Keyword in Selenium2Lib called as "Execute Javascript".
Execute Javascript in Robot

Learn Robot Framework

Reading JSON data in Angular JS (Part-1)



Scenario: - How to fetch JSON data from backend into User Interface (UI) of application using Angular JS?

Solution:-
We have divided our solution approach into 2 parts; in part-1, tutorial we would fetch the data in a straight flow, without thinking about the framework level things.

Flow:-
Reading json data using service

Code:-
JS File

//Creat app module
var app = angular.module('myApp',[])
//Creating the controller constructor
app.controller('familyCtrl',function($scope,$http){
 //Calling the get method of service 
 $http.get("data/family.json").then(function(response){
  $scope.myData = response.data;
 });

});

html file

<!DOCTYPE html>
<html ng-app="myApp">
 <head>
  <script type="text/javascript" src="js/angular.min.js"></script>
  <script type="text/javascript" src="js/controllerRead.js"></script>
  <link rel="stylesheet" type="text/css" href="css/family.css">
 </head>
 <body>
  <div  ng-controller="familyCtrl">
   <p>Reading JSON data using AngularJS Service component</p> 
   <ul>
     <li ng-repeat="x in myData.family">
       {{ x.age + ', ' +  x.role }} 
     </li>
     <li>
      House No = {{myData.house[0].no}}
     </li>
      <li>
       Income = {{myData.income}}
     </li>
   </ul>

  </div>
 </body>
</html>

Explanation:-

JS File:- it contains the business logic, which uses the get method of the service ($http), to fetch data from JSON, on success it binds data to scope (myData).

JSON File:-It consists of our JSON data. Few points to know for beginners in JSON
HTML File:-Consists of ng-app (bootstrap angular), ng-controller (using this directive to link to controller - controllerRead.js), ng-repeat (to repeat it for all the values of json element) and lastly we use the scope to display the fetched data from JSON.








Importing an library in Robot Framework comes in RED color.

Issue: - We tried adding the Selenium2Libray in robot framework but its shown in red color(in settings) and we are not able to implement any of the keywords.


library comes in red in robot framework


Root cause: - Anything coming in red in settings after importing generally means that particular library is not properly installed.

Let’s check whether we were able to install selenium2library.
Type python in cmd and type "import selenium2library", in our case it would give the error message something call stack error.
We can visualize the same error after importing selenium2library in ride and going to Tools > View in ride.
View log in Robot framework

We found some files were missing like in our case its decorator dependency that RIDE is not able to locate when loading "Selenium2Library"
No module decorator robot framework
Note: - Most of the time it’s some missing files that are not installed which results in libraries name coming in red on adding to RIDE. Like same can happen on importing "ExcelLibrary" or "Database library"

Solution:- 
Go ahead and install the missing dependency, in our case its "decorator"
Download the dependency
Open the command prompt to the extracted downloaded file
setup.py install

And we are done.

Note:- As discussed same solution can be applied to any external library that is coming as red on importing into RIDE inside settings tab.

Learn Robot Framework

New input types in HTML5

Stop managing your time. 
Start managing your focus.

We already discussed the new form elements in HTML5. Today we would highlight the new input types in HTML5. 

How many of them was introduced?
13 New Input Types.

Follow us to learn more .. FbG+,Twitter

Does my browser Supports them?
Check the compatibility chart. If any of the browser does not supports it would be rendered as text type(default type for a input type).






Functionality:-