What is iptables

What is iptables

iptables are firewall which comes along with Ubuntu. IPtables has a list of rules. but if you want to use any specific rules, you can do so.

As an example if you want to allow established sessions to receive traffic or allow incoming traffic on specific ports like 22 or blocking traffic etc “

How to run Python program in Eclipse IDE

How to run Python program in Eclipse IDE

Python is an interpreted programming language and can be easily implemented for real world applications. Python programs can be run in either command line or using IDE.

One of the IDE can be used for python programming is  Eclipse IDE where PyDev plugin can be added to Eclipse using Eclipse Market place.

I assume you already have Eclipse IDE in your machine if not you can download and install it from the eclipse.org.

Once Eclipse is functioning on your machine, then follow the below steps to install PyDev

Help >> Eclipse MarketPlace

In Search Tab, simply type “PyDeV”

Then click on Install and follow the steps.

Now you are ready to run python programs, you can refer any python scripts and try it on Eclipse.

What is the difference between Web Layer (Presentation Tier) vs Application Layer (Logic Tier) vs Database Layer (Data Tier)

What is the difference between Web Layer (Presentation Tier) vs Application Layer (Logic Tier) vs Database Layer (Data Tier)

1. Presentation Layer is the interface to outside world e.g. web site.

2. Application Layer is a framework to create the interface to the Web site or Presentation Tier

3. Database Layer is the database and associated logic needed to query details.

Web Layer (Presentation Tier)

Contains Virtual Machines and Physical Machines with OS can be Windows, UNIX or Linux

Contains Apache web Server, Apache tomcat, Sun Java Web Server or MS Internet Information Services (IIS)

Application Layer (Logic Tier)

Contains Virtual Machines and Physical Machines with OS can be Windows, UNIX or Linux

Contains Apache tomcat, Red Hat JBoss, BEA Web Logic or IBM WebSphere app server

Database Layer (Data Tier)

Contains Virtual Machines and Physical Machines with OS can be Windows, UNIX or Linux

Contains SQL or Oracle

Descriptive programming in UFT

Descriptive programming in UFT

What is Descriptive Programming?

Descriptive programming is a way writing and implementing QTP scripts by avoiding the object repository. Usually Non – Descriptive programming access this object repository, where the required object’s properties and values are stored, and execute the scripts.

While in Descriptive programming, the object properties and values are directly written in the code so no need to access the object repository while script execution time.

For example.

If QTP script needs to close a browser the following descriptive program can be used and it can close any single open browse no matter what is the content or name of the browser.

Browser(“micClass:=Browser”).close

What are the common ways that the Descriptive Programming scripts can be written?

1. Static Descriptive Programming

Here the object properties and values are directly written in the code assuming that we know the expected properties and values.

For example.

If scripts wanted to input user name and password and click ok button to login to an application.

Browser(“micClass:=Browser”).Page(“micClass:=Page”).WebEdit(“type:=text”,”name:=username”).set “– USERNAME”

Browser(“micClass:=Browser”).Page(“micClass:=Page”).WebEdit(“type:=text”,”name:=password”).set “PASSWORD”

Browser(“micClass:=Browser”).Page(“micClass:=Page”).WebButton(“type:=Button”,”name:=Login”).set “LOGIN”

2. Dynamic Descriptive Programming

Here the object properties and values collections are created and used while scrip execution time

‘ this is to declare the object variable

Dim oDesc

‘to create an blank description

Set oDesc = Description.Create

Now assign values to the blank description in “oDesc”

oDesc(“type”).value= “text”

oDesc(“name”).value= “username”

now implement it in code as below

Browser(“micClass:=Browser”).Page(“micClass:=Page”).WebEdit(oDesc).Set “– USERNAME”

Note: Dynamic Descriptive Programming is really helpful when you want to handly an array of objects and child objects.

Selenium grid hub and node configuration

Selenium grid hub and node configuration for parallel test execution

Configuring Hub machine

1) Start the command prompt/DOS prompt

2) Navigate to the folder location where the Selenium server jar file is kept.

3) Type java –jar selenium-server-standalone-[VERSION].jar –role hub

Note: [VERSION] is the one your downloaded version of selenium-server-standalone Jar file.

Your will see the below screen

Selenium Hub
Selenium Hub

4) Now type: http://localhost:4444 in browser

Your will see the below screen

5) Now type: http://localhost:4444/console in browser

You will see the below screen

Console

Configuring Node machines

To create Node machines, either couple of network machines can be used or VM machines can be used. These machines need to be registered to the hub machine (Steps are below)

Follow the same steps 1 to 2 in node machines

Then type,

Java –jar selenium-server-standalone-[VERSION].jar –role node –hub http://yourHUBmachineIP:4444/grid/register

Selenium Node

How to connect Oracle using QTP scripts

How to connect Oracle using QTP scripts.

Dim connectionMS, recordsetMS
Set connectionMS = createobject(“adodb.connection”)
Set recordsetMS =createobject(“adodb.recordset”)
connectionMS.open “Driver={Microsoft ODBC for Oracle};Server=QTPWorld; Uid=your_username;Pwd=your_password;”
recordsetMS.open “select * from yourtablename”,connectionMS
databaseValue = recordsetMS.fields.item(0)
msgbox databaseValue
Set connectionMS = nothing
Set recordsetMS = nothing

How to connect sqlserver using QTP scripts

How to connect sqlserver using QTP scripts?

Dim connectionMS, recordsetMS

Set connectionMS = createobject(“adodb.connection”)
Set recordsetMS =createobject(“adodb.recordset”)

connectionMS.open”Driver={SQL Server};server=YourSqlServer;uid=YourUserName;pwd=YourPassword;database=dbname”
recordsetMS.open “select * from tablename”,connectionMS
databaseValue = recordsetMS.fields.item(0)
msgbox databaseValue
Set connectionMS = nothing
Set recordsetMS = nothing