Java Programs for Selenium



package arrays;

public class AddTwoMatrix {
 public static void main(String args[])
   {
      int m, n, c, d;
      
      int first[][] = { {1,2}, {5,10}, {2,6} };
      int second[][] = { {2,6}, {1,2}, {5,3} };
      
      m=first.length;
      n=first[0].length;
      
      int sum[][] = new int[m][n];
      
      System.out.println("Calculating Sum of 2 matrices....");
      
      for ( c = 0 ; c < m ; c++ )
          for ( d = 0 ; d < n ; d++ )
              sum[c][d] = first[c][d] + second[c][d];  //replace '+' with '-' to subtract matrices
         

Agile Methodology Interview Questions and Answers


Q#1. What is Agile Testing?
Ans.
 Agile Testing is a practice that a QA follows in a dynamic environment where testing requirements keep changing according to the customer needs. It is done parallel to the development activity where testing team receives frequent small codes from the development team for testing.

Q#2. What is the difference between burn-up and burn-down chart?
Ans. Burn-up and burn-down charts are used to keep track the progress of the project.
Burn-up charts represent how much work has been completed in any project whereas Burn-down chart represents the remaining work in a project.

ETL Testing – data warehouse testing questions and Answers


What is a data warehouse?
A data warehouse is a database which,
1.Maintains history of data
2.Contains Integrated data (data from multiple business lines)
3.Contains Heterogeneous data (data from different source formats)
4.Contains Aggregated data
5.Allows only select to restrict data manipulation
6.Data will be stored in de-normalized 
format

ETL TESTING FAQ'S


1. What do you understand by an ETL?
ETL stands for Extract, Transform, and Load. It is an important concept in Data Warehousing systems. Extraction stands for extracting data from different data sources such as transactional systems or applications. Transformation stands for applying the conversion rules on data so that it becomes suitable for analytical reporting. The loading process involves moving the data into the target system, normally a data warehouse.

VB SCRIPT Built-in Functions


1) Asc Function

'Returns ANSI character code corresponding to first letter in a string
Dim val
val="hyderabad"
val=Asc(val)
msgbox val

2) Chr Function

'Returns the character associated with the specified ANSI character code.
Dim val
val=65
val=Chr(val)
msgbox val 'Output: A

3) Date Function
It returns current system Date
Dim myDate
myDate=Date
msgbox myDate

4) Abs Function
It returns obsolute value of the given number.
Dim num
num=157.56
num=Abs(num)
msgbox num 'Output: 157.56

num=-157.56
num=Abs(num)
msgbox num 'Output: 157.56

SQL Interview Questions & Answers


Q. What is SQL?
 
Structured Query Language, an ANSI (American National Standards Institute) standard language for accessing databases.

Using SQL we can Access Oracle, Sybase, DB2, SQL Server, MySQL, DB/400 and other Database Management Systems
 

Q. When SQL was appeared?

Structured Query Language was first appeared by IBM in 1974 and it is Free Software(any body can use with free of cost).


Q. Who should learn SQL?

• Database Developers

• Database Testers

• Database Administrators

ETL testing in Business Intelligence (BI) Applications


Importance of Business Intelligence has never been more than today. Data, Big Data, Structured, Unstructured, BI reports, BI Analytics etc are heard so often today…
This blog is focused on testing aspects of ETL(Extract, Transform, Load) part of Business Intelligence (BI) Applications. Lets talk a bit about BI Application first to bring everyone on same page and then we will go into testing strategy. Typically BI Application means building a DataWarehouse, then some DataMarts and finally a Reporting layer which could be Self Service BI (Eg. Microsoft Power BI) or Canned reports (Eg SSRS) or Power Reports. There are several others less common ways like building a UI layer to present data or futuristic ways of building a Windows 8 App as reporting layer. Other important thing to understand about BI systems is they are ‘after the fact’ reporting systems. 

ORACLE IMPORTANT QUERIES-PART2


1.     Get duplicate rows from the table:
Select empno, count (*) from EMP group by empno having count (*)>1;
2.     Remove duplicates in the table:
Delete from EMP where rowid not in (select max (rowid) from EMP group by empno);
3.     Below query transpose columns into rows.
Name
No
Add1
Add2
abc
100
Hyd
bang
xyz
200
Mysore
pune

Select name, no, add1 from A
UNION
Select name, no, add2 from A;

ORACLE IMPORTANT QUERIES-PART1


1)   To find the nth row of a table
SQL> Select *from emp where rowid = (select max(rowid) from emp where rownum <= 4);
Or
   SQL> Select *from emp where rownum <= 4 minus select *from emp where rownum <= 3;

2)   To find duplicate rows
SQL> Select *from emp where rowid in (select max(rowid) from emp group by empno,          
         ename, mgr, job, hiredate, comm, deptno, sal);
Or
 SQL> Select empno,ename,sal,job,hiredate,comm , count(*) from emp group by 
         empno,ename,sal,job,hiredate,comm  having count(*) >=1; 

Handling Authentication Window with WebDriver (In Firefox, Chrome and IE)


When you are working in a test environment, Stage or Pre Production, there are cases where you may need to work with applications which are secured with Authentication (Basic Auth).
When ever you enter the URL, it will prompt you to enter the User name and the password and It will not allow to perform any further operations until you provide username and password. And this Authentication pop-up is not a JavaScript pop-up, it is a Browser dialog window which selenium cannot handle simply using sendKeys method which we do for normal JavaScript pop-ups..

Configure parallel execution of tests using TestNG selenium


In testing, it is always important to test application in different browsers. We can perform automation on multiple browsers using selenium and testng. If there are more number of tests that need to be executed in parallel on different browsers also, we can do this using testng. And there is an other challenging task such executing tests in different browser versions and also different Operating systems. This can be achieved with Selenium Grid

How to delete Cookies in Selenium Webdriver


Delete Cookie
Delete Cookie with Name
Delete All Cookies



User can delete a cookie from the browser's "cookie jar". The domain of the cookie will be ignored.
User can delete the named cookie from the current domain. This is equivalent to setting the named cookie's expiry date to sometime in the past.

How to add cookie with Selenium Webdriver


Using webdriver we can easily pass the cookie to the domain. In order to pass cookie, we should use a method named "addCookie(cookie)"
Method Name: addCookie(Cookie cookie)
Syntax:driver.manage().addCookie(arg0);
Purpose: To add a specific cookie into cookies. If the cookie's domain name is left blank, it is assumed that the cookie is meant for the domain of the current document.
Parameters: cookie - The name and value of the cookie to be add.

How to handle javascript alerts, confirmation and prompts?


Generally JavaScript popups are generated by web application and hence they can be easily controlled by the browser.
Webdriver offers the ability to cope with javascript alerts using Alerts API 

Working with Frames in Selenium Webdriver


What is iFrame? An iFrame (Inline Frame) is an HTML document embedded inside the current HTML document on a website. iFrame HTML element is used to insert content from another source, such as an advertisement, into a Web page. A Web designer can change an iFrame's content without making them reload the complete website. A website can have multiple frames on a single page. And a frame can also have inner frames (Frame in side a Frame)

Handle windows popups using Selenium Webdriver


There are many cases, where a application displays multiple windows when you open a website. Those are may be advertisements or may be a kind of information showing on popup windows. We can handle multiple windows using Windows Handlers in selenium webdriver.
Step 1: After opening the website, we need to get the main window handle by using driver.getWindowHandle();
The window handle will be in a form of lengthy alpha numeric
Step 2: We now need to get all the window handles by using driver.getWindowHandles();
Step 3: We will compare all the window handles with the main Window handles and perform the operation the window which we need.

How to run webdriver in IE browser?


To run selenium webdriver in IE browser, we need InternetExplorerDriver which is a standalone server which implements WebDriver's wire protocol.
First of all, download latest version of IEDriver server for webdriver. You can download latest version server from Download InternetExplorerEDriver
Note: Choose the IEdriver server based on your working environment as there are two different zip files for both 32 and 64 bit IE . Recommended 32bit IEDriver which is less prone to errors when compared with 64bit driver.

How to Run Webdriver in chrome browser?


Normally to run webdriver, we just need a browser and a selenium server jar file. Selenium by-default supports Mozilla Firefox browser. Then the next question come to your mind is How to run webdriver in other browsers.
Selenium supports to run webdriver in other browsers by just adding an .exe path of the driver server for the individual browsers.
Now to run selenium webdriver in Chrome browser, we need to take the help of ChromeDriver which is a separate executable that selenium webdriver uses to control chrome. ChromeDriver is supported by the Chromium team, ChromeDriver is a standalone server which implements WebDriver's wire protocol for Chromium.

Basic HTML concepts required for Selenium


What is HTML?
As you know HTML Hyper Text Markup Language used for describing web pages. Each tag represents a document content. HTML contains tags with angle brackets like and plain text. There are two tags one is start tag and second tag is end tag. Every tag should end with a forward slash before the tag name.

What is Selenium?


Selenium is a web Automation tool which can used to perform testing ONLY on Web Applications not Desktop based applications.

There are others tool which can be used to automate both web applications and windows applications like QTP (Quick Test Professional) . As every one aware that QTP is Licensed Tool AND Selenium is Open source tool, download it configure it and enjoy.

Hadoop PIG Notes


Basic

  • Pig is a scripting platform for processing and analysing large data sets.
  • very usefulfor people who did not have java knowledge
  • used for high level data flow and processing the data available on HDFS.
  • PIG is named pig because like the animal, it can consume and process any type of data, and has lots of usage in data cleansing.
  • Internally, whatever you write in Pig, it internally converts to Map reduce(MR) jobs.
  • Pig is client side installation, it need not sit on hadoop cluster.
  • Pig script will execute a set of commands, which will be converted to Map Reduce(MR) jobs and submitted to hadoop running locally or remotely.
  • A hadoop cluster will not care whether the job was submitted from pig or from some other environment.
  • map reduce programs get executed only when the DUMP or STORE command is called(more on this later).

Hadoop Notes


Technologies in Hadoop Ecosystem

  • Hadoop => framework for distributed processing of large datasets across clusters of computers, it can scale up to thousands of machines, where each machine offers computation and data storage.
  • HBase => a scalable, distributed database that supports structured data storage for large tables.
  • Hive => a data warehouse infrastructure that provides data summarization and ad hoc querying.
  • Mahout => A scalable machine learning and data mining library.
  • Pig => data flow language and execution framework for parallel computation.
  • Spark => A fast engine for computing hadoop data.
  • Storm => a scalable and reliable engine for processing data as it flows into the system
  • Zookeeper => high performance coordination service for distributed applications.

Top Java Frequently Asked Questions- 2


51. Are true and false keywords? 
The values true and false are not keywords. 

52. What is a void return type? 
A void return type indicates that a method does not return a value after its execution. 

53. What is the difference between the File and RandomAccessFile classes? 
The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file. 

Top Java Frequently Asked Questions- 1


1. Can you write a Java class that could be used both as an applet as well as an application? 
Yes. Just, add a main() method to the applet. 

2. Explain the usage of Java packages. 
This is a way to organize files when a project consists of multiple modules. It also helps resolve naming conflicts when different packages have classes with the same names. Packages access level also allows you to protect data from being used by the non-authorized classes. 

Slowly Changing Dimensions (SCD)


The "Slowly Changing Dimension" problem is a common one particular to data warehousing. In a nutshell, this applies to cases where the attribute for a record varies over time. We give an example below:

Dimensional Data Mode


Dimensional data model is most often used in data warehousing systems. This is different from the 3rd normal form, commonly used for transactional (OLTP) type systems. As you can imagine, the same data would then be stored differently in a dimensional model than in a 3rd normal form model.

To understand dimensional data modeling, let's define some of the terms commonly used in this type of modeling:

Junk Dimension


In data warehouse design, frequently we run into a situation where there are yes/no indicator fields in the source system. Through business analysis, we know it is necessary to keep that information in the fact table. However, if keep all those indicator fields in the fact table, not only do we need to build many small dimension tables, but the amount of information stored in the fact table also increases tremendously, leading to possible performance and management issues.

Junk dimension is the way to solve this problem. In a junk dimension, we combine these indicator fields into a single dimension. This way, we'll only need to build a single dimension table, and the number of fields in the fact table, as well as the size of the fact table, can be decreased. The content in the junk dimension table is the combination of all possible values of the individual indicator fields.

MOLAP, ROLAP, And HOLAP


 In the OLAP world, there are mainly two different types: Multidimensional OLAP (MOLAP) and Relational OLAP (ROLAP). Hybrid OLAP (HOLAP) refers to technologies that combine MOLAP and ROLAP.

What Is OLAP


OLAP stands for On-Line Analytical Processing. The first attempt to provide a definition to OLAP was by Dr. Codd, who proposed 12 rules for OLAP. Later, it was discovered that this particular white paper was sponsored by one of the OLAP tool vendors, thus causing it to lose objectivity. The OLAP Report has proposed the FASMI test, Fast Analysis of Shared Multidimensional Information. For a more detailed description of both Dr. Codd's rules and the FASMI test, please visit The OLAP Report.

Data Integrity


 Data integrity refers to the validity of data, meaning data is consistent and correct. In the data warehousing field, we frequently hear the term, "Garbage In, Garbage Out." If there is no data integrity in the data warehouse, any resulting report and analysis will not be useful. 
                   
 In a data warehouse or a data mart, there are three areas of where data integrity needs to be enforced: 

Data Warehouse Schemas


A schema is a collection of database objects, including tables, views, indexes, and synonyms. You can arrange schema objects in the schema models designed for data warehousing in a variety of ways.
Star Schemas :
The star schema (also called star-join schemadata cube, or multi-dimensional schema) is the simplest style of data warehouse schema. The star schema consists of one or more fact tables referencing any number of dimension tables

DWH Modeling Methodologies


Conformed facts

In addition to conformed dimensions, you need conformed facts. Conforming a fact really amounts to standardizing the definitions of terms across individual marts. Often, different divisions or departments use the same term in different ways. Does “revenue” refer to “gross revenue” or “adjusted revenue”? Does “units shipped” refer to cases of items or individual items?
Make certain your design team develops, early on, a uniform enterprise taxonomy—and enforce it.

What is Data Warehouse?


In computing, a data warehouse (DW or DWH) is a database used for reporting and analysis. The data stored in the warehouse are uploaded from the operational systems (such as marketing, sales etc., shown in the figure to the right). The data may pass through an operational data store for additional operations before they are used in the DW for reporting.
The typical ETL-based data warehouse uses staging, integration, and access layers to house its key functions. The staging layer or staging database stores raw data extracted from each of the disparate source data systems. The integration layer integrates the disparate data sets by transforming the data from the staging layer often storing this transformed data in an operational data store (ODS) database. The integrated data is then moved to yet another database, often called the data warehouse database, where the data is arranged into hierarchical groups often called dimensions and into facts and aggregate facts. The combination of facts and dimensions is sometimes called a star schema. The access layer helps users retrieve data.

Who Qualifies For A Good Tester


Before we understand about the attributes that a proficient software tester with an advanced training on testing tools would need to possess, let us understand the simple fact that that a software tester acquires and hones a very highly sophisticated QA training and Testing skill sets that give the Tester the leverage to excel in their jobs as well as act as a value added proposition to the development projects as well.

Challenges faced by QA/Testing Teams in Devops


Quality Assurance has always been a progressive discipline in the realms of online software Testing training and development. With the continuous advancements in the IT industry, the need of the hour has increasingly come upon us to better understand, manage and manage the QA functions in a reliable and effective manner. With the inception of agile and more recently, the DevOps, the manner in which organizations develop their training,plan, organize as well as execute their QA functions has taken a complete metamorphosis.

Jenkins Step-by-Step Setup


Why Jenkins?
Jenkins is a software that allows continuous integration. Jenkins will be installed on a server where the central build will take place. The following flowchart demonstrates a very simple workflow of how Jenkins works.
Along with Jenkins, sometimes, one might also see the association of Hudson. Hudson is a very popular open-source Java-based continuous integration tool developed by Sun Microsystems which was later acquired by Oracle. After the acquisition of Sun by Oracle, a fork was created from the Hudson source code, which brought about the introduction of Jenkins.

Differences between Mobile Native Apps And Mobile Web Apps


What is a Mobile Application?

Mobile applications are applications created by companies, developers to do a specific task(for a specific use). These applications are called as mobile native applications or mobile web based applications. These applications either run on mobile devices (native apps) or on websites (mobile web apps).

Mobile Application Types:

  •   What is Mobile Native Apps: The applications that reside on the phone or that can be downloaded from OEM stores.
  •   What is Mobile Web Based Apps: The applications that can be accessed through Browsers.

Followers