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

How to connect MS Access using QTP scripts

How to connect MS Access using QTP scripts and display results

Dim connectionMS, recordsetMS

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

connectionMS.provider= “microsoft.jet.oledb.4.0”

connectionMS.open “C:\yourdatabase.mdb”
recordsetMS.open “select * from YourtableName”,connectionMS

databaseValue = recordsetMS.fields.item(0)
msgbox databaseValue

Set connectionMS = nothing
Set recordsetMS = nothing

Headless web browsers

Headless web browsers

headless web browsers or programs are used to stimulate the browsers where there is no GUI is used for browser actions,

If you want to do browser operations or collect data from UI, there programming concepts will be used.

headless web browsers are listed as below,

HtmlUnit – No GUI browser for Java programmers and its pure java implementation, Open source programs. JavaScript support/DOM emulated. mainly used for used for testing purposes or to retrieve information from web sites.

Spynner – Programmatic web browsing module having AJAX support for Python

Ghost – it is a webkit web client written in python. it is WebKit-based. JavaScript supported and Open source.

Watir-webdriver- it an open source Ruby library for automating tests. Complete JAva script Support via Browsers

Twill – Allows users to browse the Web using command-line interface . Supports automated testing on web applications and Open source.

Awesomium –  is Chromium-based. and supports JavaScript and provides HTML-powered interfaces.

ZombieJS – Open source headless testing using Node.js. JavaScript support/emulated DOM.

SimpleBrowser – Open source web browser engine designed for automation tasks. It is built for .Net framework and No JavaScript support.

QTP program to display odd and even numbers

QTP program to display odd and even numbers

‘ program to display odd numbers 

Dim OddNum,  o

o = Inputbox(“enter any value to check list of odd numbers in it”)

For OddNum = 1 To o Step 2

print OddNum

Next

‘ program to display even numbers 

Dim  EvenNum,  e

e = Inputbox(“enter any value to check list of even numbers in it”)

For EvenNum = 2 To e Step 2

print EvenNum

Next

How to do string reverse in qtp

How to do string reverse in qtp

How to do string reverse in qtp

Dim String1, String2, StringLength, i

String1 = “Happy Valentine’s Day”
StringLength = len(String1)

For i = StringLength To 1 step -1

String2 = String2 & mid(String1, i, 1)

Next

Msgbox String2

String reverse in qtp

Dim String1, String2, StringLength, i

String1 = “Shalima Prakash”
StringLength = len(String1)

For i = StringLength To 1 step -1

String2 = String2 & mid(String1, i, 1)

Next

Msgbox String2