Introduction to Selenium

There are many testing tools available in the market like QTP, SilkUI, and Selenium etc. But people prefer Selenium because Selenium is an open source (i.e. you can download this tool for free) automation testing tool. We have QTP also for automation testing but you need to pay to HP guys if you want to use QTP.

It is used exclusively for web-based applications.QTP can work on windows but Selenium can be used exclusively for web-based applications.

You can work on multiple operating systems using Selenium. Selenium is the only tool which can work on MAC, Windows, Linux, and Solaris.

Platforms supported By Selenium:

  • Windows
  • OS X (Mac OS)
  • Linux
  • Solarsis

Currently, it supports mobile as well. There is another tool called Appeium which is an extension to Selenium. Appeium provides support to IOS as well as Android.

Languages used with Selenium:

You can write Selenium code in any of the below languages

  • Java
  • C#
  • Ruby
  • Python
  • PHP
  • Perl

NOTE: If your application is built on one language, you may use some other language to automate it. Like if your application is developed in C# and to automate its testing you may use Java.

SO THE LANGUAGE WHAT YOU WRITE YOUR AUTOMATION CODE IS INDEPENDENT OF THE LANGUAGE WHAT YOUR APPLICATION IS BUILT ON.

Browsers supported by Selenium:

  • Internet Explorer
  • Firefox
  • Chrome
  • Safari and many more

Selenium is the only tool which supports cross browsers.

Due to so many features (like multiple language support, multiple browser support, multiple OS support) provided by Selenium, it is so popular in the market.

Selenium History:

Selenium came into existence in 2004 when Jason Huggins was testing an internal application at ThoughtWorks.

Available versions of Selenium:

  • Selenium 1.0 –formally we call it as RC (Remote control server). It is officially depreciated by Selenium team.

Reason for Depreciation is:

Below is the Architecture of Selenium 1.0:

Selenium 1.0 Architecture

  • Selenium 2.0 –Web Driver
  • Recently Selenium 3.0 version also came (for it, minimum java version required is 1.8)

Architecture of Selenium 2.0 –Web Driver:

Selenium 2.0 Architecture

So we are overcoming the 1st drawback of Selenium 1.0.

How 2nd drawback is overcome:

Editor instead of using java to trigger the events, uses Browsers own/native language to trigger the events (or to talk to the application). Let’s say our Firefox browser is built in  Java so to talk to a website which is running on Firefox, editor use java. Our IE is built upon C# so editor uses C# to talk to the application in C#. The website which is running on IE cannot stop C# to trigger an event so hence the 2nd problem is resolved.

Working of Selenium WebDriver:

Selenium WebDriver working can be explained in 2 ways:

  • Non-technical – using analogy
  • Technical

Non-technical – using analogy:  To explain working, analogy used is taxi driving.

The way a taxi driver drives a taxi, same way Selenium WebDriver drives a browser.

In taxi driving, there are 3 parts:

  • The client, who decides where to go and how to get there. He informs this to the taxi driver.
  • The taxi driver, who acts as per the client’s requests and sends his own requests to the car.
  • The car, it acts as per the taxi driver’s requests.

Non technical- using analogy

Similarly, in Selenium WebDriver test automation (and other tools), there are 3 parts:

  • Test engineer, who writes the automation code, which sends requests to the browser driver component.
  • The browser driver component, who executes the test requests, sent by the engineer, it sends its own request to the browser.
  • The browser, who executes the browser driver requests.

 

So this is the analogy:

  1. Test engineer <-> The client
  2. The browser <->Taxi driver
  3. The browser <->Taxi(Car)

Technical explanation:

Below steps take place when the automation script is executed:

  • For every Selenium command, a HTTP request is created and sent to the browser driver
  • Using HTTP server, the browser driver get the HTTP requests
  • The HTTP server implements the Selenium command and executes them on the browser
  • The execution status is sent back to the HTTP server which in turn sends the status back to the automation script.

Selenium Job Roles

The popular software testing job titles after doing Selenium WebDriver training are:

  • Quality Engineer
  • Automation Test Lead
  • QA Engineer
  • Selenium Automation Analyst
  • Senior Test Engineer

Visit the link for Best Selenium Training in Gurgaon.

Who should choose Software Testing as a career:

  • One who is good in solving logical puzzles: Software will go to the market if a tester says there are no bugs in the software and it is ready to release. Tester finds bugs & also breaks the system in terms of stress testing.
  • One who love helping others: A tester help in releasing a quality product to the market. To release a good product, developers do their best. But still chances are there will be some mistakes. Being a tester you need to find those mistakes.
  • One who loves to take challenges: A tester needs to explore the system for understanding and finding bugs. Then he reports the bugs, which are fixed by the developer. Hence finally a quality product is delivered to the market.
  • One who loves to write code: A Automation Tester writes code to find the bugs in the system and thus a quality product will be delivered.
  • One who loves to interact with people: A tester needs to interact with developers and client to get more information on domain knowledge.
  • One who loves to be in a team where quality products will be delivered: Being a tester one help in delivering a quality product which makes everybody happy.
Posted in Selenium | Tagged , , | Leave a comment

Trainer Profile – Ritu Bajar

Trainer Profile - Ritu Bajar

Ritu Bajar

Ritu Bajar, a highly accomplished trainer, has an extensive work experience of 10+ years in IT Industry.

She holds a B.Tech degree in Computer Science and Engineering from ITM, Gurgaon, now known as NorthCamp University. She has 5+ years of training experience in Selenium and Java. She has worked with companies like TCS, TSYS International etc.

She is “International Software Testing Qualifications Board” certified professional.

Her contribution to students’ success is, support in training, with the best theoretical example, and practical.

Her passion for training program led to the establishment of “RedBush Technologies – Best Training Institute in Gurgaon” in 2013.

Having shouldered responsibilities of business management and training brings a wealth of corporate experience which reinforces her skills to impact and connect with students.

She has trained above 200 students in her carrier.

Ritu’s deep perspective, yet surprisingly simplicity leave an everlasting impact on the students as well as the ones who get to know her.  She is full of Passion and Purpose, is high spirited and, has a never-ending approach towards innovation.

Ritu is providing training on following courses –

  • Selenium Automation Testing
  • Java – Core Java to Advance Java
  • C/C++ Programming Language

Below is the latest review from her student says, “RedBush Technologies is the best selenium training institute in Gurgaon“.

Posted in Selenium, Trainer Profile | Tagged , , | Leave a comment

Cache Snapshots and History Snapshots in SSRS 2016

While taking training classes for national and International students, I have often seen them getting confused with the way snapshot options work in SSRS 2016. So I thought of putting it in an article.

The first thing to understand here is what a snapshot is? As the name suggests, just like a picture, A snapshot is a picture of data at that given moment. Once you click a snapshot, it stays that way and doesn’t change unless you replace it with another snapshot.

Same way in SSRS, a snapshot stores the data of a report at a given moment. After understanding what a snapshot is, let’s now explore the snapshot options in SSRS 2016. There are actually 2 options in SSRS related to snapshots:

  1. First option is to always run a report from a snapshot. What this means is that your report will always pull data from a predefined snapshot. Below image shows this option:

Here I have selected the RedBushSalesReport to be run from a snapshot.

You may choose the option “Create a cache snapshot when I click Apply on this page”, if you choose to create the snapshot immediately after you click the Apply button. There afterwards, your report will always pull data from this snapshot. If the data changes in database, you will still keep getting the same data.

Also note that if the report has any parameters, then you need to specify a default value for them to generate the snapshot as shown below:

 

 

If you don’t specify default values for parameters, then you will get below error:

 

Now if you run/refresh multiple times, you will notice that report is returning same data. Notice that you will not be allowed to change the parameter value now! Since the report is supposed to come from a snapshot, which has a default parameter, you will be able to run it with that default parameter(s) only. I refreshed the RedBushSalesReport multiple times, and every time it displayed the same execution time, which confirms that the data is coming from a static snapshot. Also I am not able to change the parameter also.

 

Sometimes you may have a requirement to run a report with fixed parameters on daily basis and if the report is really heavy and takes time to generate, then you may choose to schedule the snapshot, say before the office times starts and then everybody will be able to run the report quickly. And your boss will be happy to see the performance! Remember you should schedule the snapshot depending upon how long you can afford to show the stale data. Below image shows the scheduling of snapshot:

 

Notice that whenever you are generating snapshots using any of the above two options, by default no history of snapshots is being maintained. You can check this by clicking the “History Snapshots” option.

Now let’s see what History snapshots are. The main purpose of  a Report History snapshot is to keep a copy of the report at a specific point of time. So if you want to keep track of how your report looked at different points of time. You can generate the History Snapshots by clicking the “New History Snapshot” button as shown below:

 

If I click the “View History Snapshot” button, I will see the report with this new snapshot. What will happen if run the report normally by going back to “Browse”? Will I see the report with this snapshot or the older snapshot that we generated? We will see the report with older snapshot only. So that means your report doesn’t pull data from history snapshots. They are just used to keep a trail of how your report looks at different specific times.

Can I keep a history of snapshots that I generate from the Caching tab? Yes, you can. From History snapshots tab, go to Schedule and Settings option as shown below:

 

Using this option, you can specify to save Cache snapshots in History as well. You cal also specify how many history snapshots you want to retain. Additionally you can generate the History snapshots at pre defined schedule. All these options are shown below.

 

So you must have noticed that there can be only one report execution snapshot at a time, but there can be many History snapshots.

I hope this clarifies the difference between History snapshots and report execution cached snapshots.

If you have any questions, I’ll be happy to respond in the discussion forum of this article.

Thank you

Suresh

RedBush

Posted in Microsoft BI | Tagged , , , | Leave a comment

How to set up SQL Server Transactional Replication : Multiple Publishers, Single Subscriber

 

SQL ReplicationWhile providing a replication solution to one of my client in SQL Server 2016, I came across a scenario where the client had retail stores at various locations and all data from those stores had to be synchronized at a central location in real time. The aim of this synchronization was to make it easy for senior management to analyze all stores performance from a single location. After giving considerations to different options, I finally came up with a solution that worked for my client.

 

Let’s assume we have server  RBTSERV1 and RBTSERV2, which will act as publisher for 2 stores. RBTSERV3 will act as a subscriber and data from both servers RBTSERV1 and RBTSERV2 will be synchronized to RBTSERV3.

 

There were several tables that needed to be synchronized but to keep it simple, I will take 1 table in our example.

 

Notice that All stores have a unique StoreId assigned to them.Let’s create some sample table and data on all servers.

 

–RBTSERV1:PUBLISHER 1

create database DBPub1

use DBPub1

create table CustomerOrders(StoreID int ,OrderId int, ItemName varchar(100), Qty int, OrderDate datetime default getdate()

, CONSTRAINT PK_CustomerOrders PRIMARY KEY (StoreID,OrderId))

 

INSERT INTO CustomerOrders VALUES (1,1,’Books’,5,Getdate())

INSERT INTO CustomerOrders VALUES (1,2,’Toys’,3,Getdate())

———————————

–RBTSERV2: PUBLISHER2

create database DBPub2

use DBPub2

create table CustomerOrders(StoreID int ,OrderId int, ItemName varchar(100), Qty int, OrderDate datetime default getdate()

, CONSTRAINT PK_CustomerOrders PRIMARY KEY (StoreID,OrderId))

 

INSERT INTO CustomerOrders VALUES (2,1,’fans’,15,Getdate())

INSERT INTO CustomerOrders VALUES (2,2,’pens’,13,Getdate())

———————————

–RBTSERV3:SUBSCRIBER

create table CustomerOrders(StoreID int ,OrderId int, ItemName varchar(100), Qty int, OrderDate datetime default getdate()

, CONSTRAINT PK_CustomerOrders PRIMARY KEY (StoreID,OrderId))

 

So publisher RBTSERV1 has 2 records in the table and publisher RBTSERV2 also has 2 records in the table. Subscriber doesn’t have any records.

 

Now let’s start with our replication.

 

Configuring Publication on RBTSERV1:

To setup a publication on RBTSERV1, Follow the below steps:

  1. Right Click on folder “Local Publication” and select “New Publication…”

 

 

  1. In the publication wizard, select the database to be used for Publication. In our case, we are using DBPub1.

 

 

  1. Since we have to make the sync almost real time, so we choose Transaction replication.

 

 

 

  1. Next we pick the table we wish to use for our replication. Here the important point is to choose the “Properties for all Table Articles” under “Article Properties” as below:

Action if name is in use: Keep Existing Object Unchaged

 

 

 

 

  1. Next we leave the “Create a Snapshot Immediately…” option unchecked.

 

 

  1. Under Agent security, choose the options below. Note that on my server, SQL and Agent services are running under administrator account.

 

 

  1. Give your publication a name and click Finish.

 

  1. The publication wizard should finish without any error.

 

 

  1. Next repeat the same steps for RBTSERV2 and give your publication a name SERV2_Publication.
  2. Now right click on Publication SERV1_Publication and choose “New Subscriptions…”.  In the Subscription wizard, choose your publication as SERV1_Publication

 

 

 

 

  1. Then you select if you wish to have a push or pull subscription. Here I have used Push Subscriptions

 

 

 

 

 

  1. Now you select your subscriber name and the subscription database. Here I have used RBTSERV3 as subscriber and DBSubs as subscriber database.

 

 

  1. Configure the distributor Agent security.

 

 

  1. Choose to run the distributor Agent Continuously.

 

 

  1. It is important not to initialize the subscription as we will be manually synchronizing the old data.

 

 

 

  1. Finally finish the subscription wizard.

 

 

  1. Now if you check the log reader agent status of RBTSERV1 or RBTSERV2, you should see it running fine.

 

 

  1. And now if you check data in subscriber table using below query, there should be no data.SELECT *   FROM [DBSubs].[dbo].[CustomerOrders]

 

Now let’s add some new records to both servers.

 

–RBTSERV1

INSERT INTO CustomerOrders VALUES (1,5,’notebooks’,15,Getdate())

–RBTSERV2

INSERT INTO CustomerOrders VALUES (2,6,’erasers’,150,Getdate())

  1. Now finally check that the new records from both stores have come to subscriber table.

 

 

  1. Now you can sync the old records from both stores either using a SQL query or export import wizard. Now in future if you wish to reinitialize just one store, you may delete the data of that store from subscriber and manually sync the data from that store using queries

or export import wizard.

So that’s that. Hope it helped. If you have any issue in understanding the article, feel free to contact us and we will surely help you. Call or whatsapp – +91 997148322

 

email- support@redbushtechnologies.

 

Author- Suresh Kumar – A seasoned SQL DBA with more than 15 years of experience in working with fortune 500 MNCs.

 

Thank you

Team RedBush

 

 

 

 

Posted in SQL DBA Tutorials | Tagged , , , , , , | 4 Comments

Question for Campus Preparation

What will be the output ?

#include<stdio.h>

int main()

{

int x=5;

if(x>3>2)

printf(“Hello %d”,x);

else

printf(“Hi %d”,x);

}

ANS:  Hi 5

Explanation:  Here inside if we have written x>3>2 i.e 5>3>2  .In it 2 operators are there and both are same so they are of same priority so question comes which one should get evaluated first .In case of same precedence operators we solve the expression from left to right so first 5>3 will be evaluated which is true so finally our expression will become 1>2 as true means 1 and false means 0.Now this final expression will be evaluated and it will give you result as false.

 

Posted in Campus Preparation | Tagged , , , , | Leave a comment