SlideShare a Scribd company logo
QTP: Not just for GUI anymore




  Prepared by: Igor Gershovich
  www.connectedtesting.com
The true beauty of QTP is
that the only limitation is
your imagination and ability
to code in VBScript.

                   Ian Fraser
Topics

   Web Services
   Telnet
   FTP
   XML
Advantages using APIs

   Accessing non-GUI applications via API
    directly:
       Increases test execution speed
       Reduces synchronization problems related to GUI
         window like Telnet, DOS CMD, PuTTY, Exceed,
        etc.
       Allows execute scripts on locked boxes
       No need for QTP add-ins
Let’s talk about Component Object Model
(COM) first
  COM is used by developers to create
  reusable software components, link
  components together to build applications,
  and take advantage of Windows services.
The family of COM technologies includes:
 COM+

 Distributed COM (DCOM)

 ActiveX Controls.
COM methods and properties
   COM properties and methods
      Properties don’t take any arguments and can be read/write
    value = object.property          (read)
    object.property = value          (write)
     Methods are read only if they returns value

    value = object.method()          (returns value)
    Set RS = Conn.Execute(“Select * From Tbl") (returns object)
    Conn.Close                       (returns no value)
    tdc.Login “username", “psw"      (method with parameters,
                                     returns no value)
VBScript CreateObject function
  CreateObject function creates and returns a
  reference to an Automation object
  CreateObject(servername.typename [, location])

Example connecting to Quality Center (QC):

Set tdc = CreateObject ("TDApiOle80.TDConnection")
tdc.InitConnectionEx sServerName 'Connect
tdc.Login sUser, sPassword
tdc.Connect sDomain, sProject
COM objects in Registry editor
Resources:

   Microsoft “COM: Component Object Model
    Technologies”
    www.microsoft.com/com/default.mspx
   “COM for ASP Programmers”
    By Wayne Berry
    http://www.15seconds.com/Issue/971214.htm
File Transfer Protocol (FTP)
Using WinInet API for FTP

   Windows WinINet.DLL enables applications
    to interact with the following protocols:
       FTP
       HTTP
       Gopher
WinInet FTP hierarchy
FTP: File download steps

1.   Open an FTP session with InternetOpen
     function. The function returns a session
     handle.
2.   Connect to the host by calling the
     InternetConnect function using session
     handle. It returns a connection handle.
3.   Call the FtpGetFile function to get the file.
4.   Close the handles created in Steps 1 and 2,
     using the InternetCloseHandle function
FTP: File download Script
FTP: File download is successful
ActiveX components (COM) for FTP

   The are numerous ActiveX (COM)
    components for FTP free and not free:
       by Chilkat Software www.chilkatsoft.com
       by Easewe Software www.easewe.com
       by X360 Software www.x360soft.com
       by Dart Communications www.dart.com
       etc.
FTP: Download file using Chilkat’s
ActiveX component (COM)
Resources:

 “FTP your scripts” by Dani Vainstein
www.advancedqtp.com
 “Creating an FTP Component in Visual

  Basic”
By Jeff Niblack www.15seconds.com
Telnet to Unix/Linux using
COM objects
A little bit of history
 A while back I had to automate a Client/Server application and
 execute quite a few UNIX commands on a backend.
 After trying several things, like PuTTY, TE Add-in, Exceed, etc.
 Exceed worked decent enough, but it was a complicated
 solution. I had to use "Capture to File" feature and then parse the
 file.
 After working with LoadRunner WinSock protocol for Telnet
 interface I start looking for WinSock (ActiveX) COM interface that
 can be used in QTP
 The goal was to connect to Unix/Linux box bypassing external
 GUI applications and execute scripts on locked boxes. Another
 reason was that QTP has problems with GetVisibleText method.
ActiveX components (COM) for Telnet

   The are numerous ActiveX (COM)
    components for Telnet free and not free:
       by Dimac Development www.dimac.net
       EasyCom 3.1
        www.sharewareconnection.com/easycom.htm
       by Dart Communications www.dart.com
       etc.
Dimac w3sockets DLL methods and
properties
  COM Object - socket.tcp
 Buffer : String
 DoTelnetEmulation : Boolean
 Host : String
 TelnetEmulation : String
 TimeOut : Integer
 Close() :
 GetLine() : String
 GetText( len ) : String
 Open() :
 SendLine( Line ) :
 SendText( text ) :
 Wait() :
 WaitFor( Substring ) : Boolean
 WaitForDisconnect() :
Dimac W3Socket API installation
   You need to download W3Socket Dll to your
    location and register it using SocketReg.exe
    included in a zip file.
   Note: Readme said that you need to
    download winsock2 also - ignore it.

   The full W3Sockets reference is located:

    http://www.dimac.net/Products/FreeProducts/w3S
Example for Unix/Linux
   The function on next slide:
       connect to Unix/Linux box via Telnet
       navigates to TestDirectory
       executes “grep” command
       returns “grep” results

   You can also find more examples on Web:
       http://www.tek-tips.com/viewthread.cfm?qid=938038&page=3
       http://www.mediamonkey.com/forum/viewtopic.php?t=21124
W3Sockets API limitation

   This API has a problem with SendLine
    method when sending over 80 characters.
Web Services and XML
Web Services architecture
HP/Mercury Solutions for WebServices

   The HP Service Test software – is a SOA
    testing solution that simplifies and accelerates
    the automated functional testing of SOA
    services. HP Service Test Management module
    plugs into Quality Center
   QTP Web Services add-in
Windows APIs for Web Services

   HP Service Test and QTP Web Services
    Add-in are great solutions for comprehensive
    Web Services testing. However, the
    lightweight solution using Windows APIs
    works perfect in most cases.
WinHTTP DLL

   Microsoft Windows HTTP Services
    (WinHTTP) provides developers with a
    server-supported, high-level interface to the
    HTTP/1.1 Internet protocol.
   WinHTTP WinHttpRequest COM object
    uses Winhttp.dll
WinHttp.WinHttpRequest.5.1 Methods
and Properties
Methods of WinHttp
   Abort: Aborts a WinHTTP Send method.
   GetAllResponseHeaders: Retrieves all HTTP response headers.
   GetResponseHeader: Retrieves the HTTP response headers.
   Open: Opens an HTTP connection to an HTTP resource.
   Send: Sends an HTTP request to an HTTP server.
   SetAutoLogonPolicy: Sets the current Automatic Logon Policy.
   SetClientCertificate: Selects a client certificate to send to a Secure Hypertext Transfer Protocol (HTTPS)
    server.
   SetCredentials: Sets credentials to be used with an HTTP server—either an origin or a proxy server.
   SetProxy: Sets proxy server information.
   SetRequestHeader: Adds, changes, or deletes an HTTP request header.
   SetTimeouts: Specifies, in milliseconds, the individual time-out components of a send/receive operation.
   WaitForResponse: Specifies the wait time, in seconds, for an asynchronous Send method to complete,
    with optional time-out value.
Properties of WinHttp
   Option: Sets or retrieves a WinHTTP option value.
   ResponseBody: Retrieves the response entity body as an array of unsigned bytes.
   ResponseStream: Retrieves the response entity body as an IStream.
   ResponseText: Retrieves the response entity body as a string.
   Status: Retrieves the HTTP status code from the last response.
   StatusText: Retrieves HTTP status text.
ChangeMetricWeightUnit Web Service on-line
http://www.webservicex.net/convertMetricWeight.asmx
ChangeMetricWeightUnit Web Service WSDL
Using Http.WinHttpRequest.5.1 for
WebServices
WinHttp.WinHttpRequest.5.1 snippet
' WinHttp.WinHttpRequest.5.1 Object
Set oWinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
oWinHttpReq.Open "POST", sWebService_Url, False
oWinHttpReq.setRequestHeader "Content-Type", sContentType
oWinHttpReq.setRequestHeader "SOAPAction", sSOAPAction

'Send SOAP request
oWinHttpReq.Send sSOAP_Request

'Get XML Response
sXMLResponse = oWinHttpReq.ResponseText
SOAP XML Response
Off topic: Using WinHTTP for Web
pages
HTML Response
Msxml2.DOMDocument

   A DOM for XML is an object model that
    exposes the contents of an XML document
   We use the XML DOM by creating an
    instance of an XML parser
   CreateObject(“Msxml2.DOMDocument ”) is
    the method to create an instance of the
    Parser object
   Msxml2.DOMDocument COM object uses
    Msxml.dll
XML Request file
Using Msxml2.DOMDocument to load
XML file
Msxml2.DOMDocument Code Snippet

'lMsxml2.DOMDocument
Set oInputXmlDoc = CreateObject("Msxml2.DOMDocument")
  'loadXML from file
oInputXmlDoc.load("C:XML_Files_DemoWeight_Conversion.xml")
…
…
'Send SOAP request
oWinHttpReq.Send oInputXmlDoc
QTP XML Objects

   XMLUtil Object
   XMLAttribute Object
   XMLAttributesColl Object
   XMLData Object
   XMLElement Object
   XMLElementsColl Object
   XMLFile Object
   XMLItemColl Object
Example: Compare XML files using QTP
objects
Comparison results
Resources:

   MSDN
    http://msdn.microsoft.com/en-us/library/aa384109
   Stefan Thelenius about Software Testing
    http://abouttesting.blogspot.com
   QuickTest Professional Help file
Igor Gershovich

   E-Mail: igershovich@connectedtesting.com
   Phone: 720-933-9395
   www.connectedtesting.com

More Related Content

What's hot

The Ring programming language version 1.5.2 book - Part 176 of 181
The Ring programming language version 1.5.2 book - Part 176 of 181The Ring programming language version 1.5.2 book - Part 176 of 181
The Ring programming language version 1.5.2 book - Part 176 of 181
Mahmoud Samir Fayed
 
QTP Online Training
QTP Online Training QTP Online Training
QTP Online Training
G Chandra Reddy
 
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
Andrey Karpov
 
Qtp faqs
Qtp faqsQtp faqs
Qtp faqs
Ramu Palanki
 
The Ring programming language version 1.5.4 book - Part 180 of 185
The Ring programming language version 1.5.4 book - Part 180 of 185The Ring programming language version 1.5.4 book - Part 180 of 185
The Ring programming language version 1.5.4 book - Part 180 of 185
Mahmoud Samir Fayed
 
Qtp commands
Qtp commandsQtp commands
Qtp commands
G.C Reddy
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleiner
Max Kleiner
 
Introduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxIntroduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicox
David Rodenas
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Carol McDonald
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
Hithem Ahmed
 
PVS-Studio for Visual C++
PVS-Studio for Visual C++PVS-Studio for Visual C++
PVS-Studio for Visual C++
Andrey Karpov
 
Qtp certification questions
Qtp certification questionsQtp certification questions
Qtp certification questions
Ramu Palanki
 
20111018 boost and gtest
20111018 boost and gtest20111018 boost and gtest
20111018 boost and gtest
Will Shen
 
Data Base Testing Interview Questions
Data Base Testing Interview QuestionsData Base Testing Interview Questions
Data Base Testing Interview Questions
Rita Singh
 
Introduction to OpenCV 3.x (with Java)
Introduction to OpenCV 3.x (with Java)Introduction to OpenCV 3.x (with Java)
Introduction to OpenCV 3.x (with Java)
Luigi De Russis
 
Quickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsQuickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop Applications
Clare Macrae
 
PVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ codePVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ code
Andrey Karpov
 
The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196
Mahmoud Samir Fayed
 
Logic-based program transformation in symbiosis with Eclipse
Logic-based program transformation in symbiosis with EclipseLogic-based program transformation in symbiosis with Eclipse
Logic-based program transformation in symbiosis with Eclipse
Coen De Roover
 

What's hot (19)

The Ring programming language version 1.5.2 book - Part 176 of 181
The Ring programming language version 1.5.2 book - Part 176 of 181The Ring programming language version 1.5.2 book - Part 176 of 181
The Ring programming language version 1.5.2 book - Part 176 of 181
 
QTP Online Training
QTP Online Training QTP Online Training
QTP Online Training
 
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
PVS-Studio 5.00, a solution for developers of modern resource-intensive appl...
 
Qtp faqs
Qtp faqsQtp faqs
Qtp faqs
 
The Ring programming language version 1.5.4 book - Part 180 of 185
The Ring programming language version 1.5.4 book - Part 180 of 185The Ring programming language version 1.5.4 book - Part 180 of 185
The Ring programming language version 1.5.4 book - Part 180 of 185
 
Qtp commands
Qtp commandsQtp commands
Qtp commands
 
Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleiner
 
Introduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicoxIntroduction to web programming for java and c# programmers by @drpicox
Introduction to web programming for java and c# programmers by @drpicox
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
 
Java concurrency
Java concurrencyJava concurrency
Java concurrency
 
PVS-Studio for Visual C++
PVS-Studio for Visual C++PVS-Studio for Visual C++
PVS-Studio for Visual C++
 
Qtp certification questions
Qtp certification questionsQtp certification questions
Qtp certification questions
 
20111018 boost and gtest
20111018 boost and gtest20111018 boost and gtest
20111018 boost and gtest
 
Data Base Testing Interview Questions
Data Base Testing Interview QuestionsData Base Testing Interview Questions
Data Base Testing Interview Questions
 
Introduction to OpenCV 3.x (with Java)
Introduction to OpenCV 3.x (with Java)Introduction to OpenCV 3.x (with Java)
Introduction to OpenCV 3.x (with Java)
 
Quickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsQuickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop Applications
 
PVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ codePVS-Studio advertisement - static analysis of C/C++ code
PVS-Studio advertisement - static analysis of C/C++ code
 
The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196
 
Logic-based program transformation in symbiosis with Eclipse
Logic-based program transformation in symbiosis with EclipseLogic-based program transformation in symbiosis with Eclipse
Logic-based program transformation in symbiosis with Eclipse
 

Similar to Qtp not just for gui anymore

Testing with test_complete
Testing with test_completeTesting with test_complete
Testing with test_complete
binuiweb
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
justmeanscsr
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
Mickaël Rémond
 
MSMDC_CLI363
MSMDC_CLI363MSMDC_CLI363
MSMDC_CLI363
mokacao
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
Cathie101
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
Cathie101
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
Deepankar Pathak
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
Rishi Kothari
 
How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with
Ionela
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
John Congdon
 
ASP.NET Core 3.0 Deep Dive
ASP.NET Core 3.0 Deep DiveASP.NET Core 3.0 Deep Dive
ASP.NET Core 3.0 Deep Dive
Jon Galloway
 
Using Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network SystemsUsing Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network Systems
antonry
 
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Alex Thissen
 
Web services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsWeb services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows Forms
Peter Gfader
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
Jonas Follesø
 
Dot Net Framework
Dot Net FrameworkDot Net Framework
Dot Net Framework
ssa2010
 
Presentation On Com Dcom
Presentation On Com DcomPresentation On Com Dcom
Presentation On Com Dcom
Bharat Kumar Katur
 
Html5
Html5Html5
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 

Similar to Qtp not just for gui anymore (20)

Testing with test_complete
Testing with test_completeTesting with test_complete
Testing with test_complete
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
OneTeam Media Server
OneTeam Media ServerOneTeam Media Server
OneTeam Media Server
 
MSMDC_CLI363
MSMDC_CLI363MSMDC_CLI363
MSMDC_CLI363
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with How to Integrate Internet of Things with Webserver with
How to Integrate Internet of Things with Webserver with
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
ASP.NET Core 3.0 Deep Dive
ASP.NET Core 3.0 Deep DiveASP.NET Core 3.0 Deep Dive
ASP.NET Core 3.0 Deep Dive
 
Using Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network SystemsUsing Groovy to empower WebRTC Network Systems
Using Groovy to empower WebRTC Network Systems
 
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
 
Web services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsWeb services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows Forms
 
Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008Silverlight 2 for Developers - TechEd New Zealand 2008
Silverlight 2 for Developers - TechEd New Zealand 2008
 
Dot Net Framework
Dot Net FrameworkDot Net Framework
Dot Net Framework
 
Presentation On Com Dcom
Presentation On Com DcomPresentation On Com Dcom
Presentation On Com Dcom
 
Html5
Html5Html5
Html5
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 

More from Pragya Rastogi

Gl android platform
Gl android platformGl android platform
Gl android platform
Pragya Rastogi
 
Qtp tutorial
Qtp tutorialQtp tutorial
Qtp tutorial
Pragya Rastogi
 
Qtp4 bpt
Qtp4 bptQtp4 bpt
Qtp4 bpt
Pragya Rastogi
 
Get ro property outputting value
Get ro property outputting valueGet ro property outputting value
Get ro property outputting value
Pragya Rastogi
 
Bp ttutorial
Bp ttutorialBp ttutorial
Bp ttutorial
Pragya Rastogi
 
Gl istqb testing fundamentals
Gl istqb testing fundamentalsGl istqb testing fundamentals
Gl istqb testing fundamentals
Pragya Rastogi
 
Gl scrum testing_models
Gl scrum testing_modelsGl scrum testing_models
Gl scrum testing_models
Pragya Rastogi
 
My Sql concepts
My Sql conceptsMy Sql concepts
My Sql concepts
Pragya Rastogi
 
Oops
OopsOops
Java programming basics
Java programming basicsJava programming basics
Java programming basics
Pragya Rastogi
 
70433 Dumps DB
70433 Dumps DB70433 Dumps DB
70433 Dumps DB
Pragya Rastogi
 
70 433
70 43370 433
70562-Dumps
70562-Dumps70562-Dumps
70562-Dumps
Pragya Rastogi
 
70562 (1)
70562 (1)70562 (1)
70562 (1)
Pragya Rastogi
 
32916
3291632916
70 562
70 56270 562
Mobile testingartifacts
Mobile testingartifactsMobile testingartifacts
Mobile testingartifacts
Pragya Rastogi
 
GL_Web application testing using selenium
GL_Web application testing using seleniumGL_Web application testing using selenium
GL_Web application testing using selenium
Pragya Rastogi
 
Gl qtp day 3 1
Gl qtp day 3   1Gl qtp day 3   1
Gl qtp day 3 1
Pragya Rastogi
 
Gl qtp day 1 & 2
Gl qtp   day 1 & 2Gl qtp   day 1 & 2
Gl qtp day 1 & 2
Pragya Rastogi
 

More from Pragya Rastogi (20)

Gl android platform
Gl android platformGl android platform
Gl android platform
 
Qtp tutorial
Qtp tutorialQtp tutorial
Qtp tutorial
 
Qtp4 bpt
Qtp4 bptQtp4 bpt
Qtp4 bpt
 
Get ro property outputting value
Get ro property outputting valueGet ro property outputting value
Get ro property outputting value
 
Bp ttutorial
Bp ttutorialBp ttutorial
Bp ttutorial
 
Gl istqb testing fundamentals
Gl istqb testing fundamentalsGl istqb testing fundamentals
Gl istqb testing fundamentals
 
Gl scrum testing_models
Gl scrum testing_modelsGl scrum testing_models
Gl scrum testing_models
 
My Sql concepts
My Sql conceptsMy Sql concepts
My Sql concepts
 
Oops
OopsOops
Oops
 
Java programming basics
Java programming basicsJava programming basics
Java programming basics
 
70433 Dumps DB
70433 Dumps DB70433 Dumps DB
70433 Dumps DB
 
70 433
70 43370 433
70 433
 
70562-Dumps
70562-Dumps70562-Dumps
70562-Dumps
 
70562 (1)
70562 (1)70562 (1)
70562 (1)
 
32916
3291632916
32916
 
70 562
70 56270 562
70 562
 
Mobile testingartifacts
Mobile testingartifactsMobile testingartifacts
Mobile testingartifacts
 
GL_Web application testing using selenium
GL_Web application testing using seleniumGL_Web application testing using selenium
GL_Web application testing using selenium
 
Gl qtp day 3 1
Gl qtp day 3   1Gl qtp day 3   1
Gl qtp day 3 1
 
Gl qtp day 1 & 2
Gl qtp   day 1 & 2Gl qtp   day 1 & 2
Gl qtp day 1 & 2
 

Recently uploaded

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 

Recently uploaded (20)

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 

Qtp not just for gui anymore

  • 1. QTP: Not just for GUI anymore Prepared by: Igor Gershovich www.connectedtesting.com
  • 2. The true beauty of QTP is that the only limitation is your imagination and ability to code in VBScript. Ian Fraser
  • 3. Topics  Web Services  Telnet  FTP  XML
  • 4. Advantages using APIs  Accessing non-GUI applications via API directly:  Increases test execution speed  Reduces synchronization problems related to GUI window like Telnet, DOS CMD, PuTTY, Exceed, etc.  Allows execute scripts on locked boxes  No need for QTP add-ins
  • 5. Let’s talk about Component Object Model (COM) first COM is used by developers to create reusable software components, link components together to build applications, and take advantage of Windows services. The family of COM technologies includes:  COM+  Distributed COM (DCOM)  ActiveX Controls.
  • 6. COM methods and properties  COM properties and methods  Properties don’t take any arguments and can be read/write value = object.property (read) object.property = value (write)  Methods are read only if they returns value value = object.method() (returns value) Set RS = Conn.Execute(“Select * From Tbl") (returns object) Conn.Close (returns no value) tdc.Login “username", “psw" (method with parameters, returns no value)
  • 7. VBScript CreateObject function CreateObject function creates and returns a reference to an Automation object CreateObject(servername.typename [, location]) Example connecting to Quality Center (QC): Set tdc = CreateObject ("TDApiOle80.TDConnection") tdc.InitConnectionEx sServerName 'Connect tdc.Login sUser, sPassword tdc.Connect sDomain, sProject
  • 8. COM objects in Registry editor
  • 9. Resources:  Microsoft “COM: Component Object Model Technologies” www.microsoft.com/com/default.mspx  “COM for ASP Programmers” By Wayne Berry http://www.15seconds.com/Issue/971214.htm
  • 11. Using WinInet API for FTP  Windows WinINet.DLL enables applications to interact with the following protocols:  FTP  HTTP  Gopher
  • 13. FTP: File download steps 1. Open an FTP session with InternetOpen function. The function returns a session handle. 2. Connect to the host by calling the InternetConnect function using session handle. It returns a connection handle. 3. Call the FtpGetFile function to get the file. 4. Close the handles created in Steps 1 and 2, using the InternetCloseHandle function
  • 15. FTP: File download is successful
  • 16. ActiveX components (COM) for FTP  The are numerous ActiveX (COM) components for FTP free and not free:  by Chilkat Software www.chilkatsoft.com  by Easewe Software www.easewe.com  by X360 Software www.x360soft.com  by Dart Communications www.dart.com  etc.
  • 17. FTP: Download file using Chilkat’s ActiveX component (COM)
  • 18. Resources:  “FTP your scripts” by Dani Vainstein www.advancedqtp.com  “Creating an FTP Component in Visual Basic” By Jeff Niblack www.15seconds.com
  • 19. Telnet to Unix/Linux using COM objects
  • 20. A little bit of history A while back I had to automate a Client/Server application and execute quite a few UNIX commands on a backend. After trying several things, like PuTTY, TE Add-in, Exceed, etc. Exceed worked decent enough, but it was a complicated solution. I had to use "Capture to File" feature and then parse the file. After working with LoadRunner WinSock protocol for Telnet interface I start looking for WinSock (ActiveX) COM interface that can be used in QTP The goal was to connect to Unix/Linux box bypassing external GUI applications and execute scripts on locked boxes. Another reason was that QTP has problems with GetVisibleText method.
  • 21. ActiveX components (COM) for Telnet  The are numerous ActiveX (COM) components for Telnet free and not free:  by Dimac Development www.dimac.net  EasyCom 3.1 www.sharewareconnection.com/easycom.htm  by Dart Communications www.dart.com  etc.
  • 22. Dimac w3sockets DLL methods and properties COM Object - socket.tcp Buffer : String DoTelnetEmulation : Boolean Host : String TelnetEmulation : String TimeOut : Integer Close() : GetLine() : String GetText( len ) : String Open() : SendLine( Line ) : SendText( text ) : Wait() : WaitFor( Substring ) : Boolean WaitForDisconnect() :
  • 23. Dimac W3Socket API installation  You need to download W3Socket Dll to your location and register it using SocketReg.exe included in a zip file.  Note: Readme said that you need to download winsock2 also - ignore it.  The full W3Sockets reference is located: http://www.dimac.net/Products/FreeProducts/w3S
  • 24. Example for Unix/Linux  The function on next slide:  connect to Unix/Linux box via Telnet  navigates to TestDirectory  executes “grep” command  returns “grep” results  You can also find more examples on Web:  http://www.tek-tips.com/viewthread.cfm?qid=938038&page=3  http://www.mediamonkey.com/forum/viewtopic.php?t=21124
  • 25.
  • 26. W3Sockets API limitation  This API has a problem with SendLine method when sending over 80 characters.
  • 29. HP/Mercury Solutions for WebServices  The HP Service Test software – is a SOA testing solution that simplifies and accelerates the automated functional testing of SOA services. HP Service Test Management module plugs into Quality Center  QTP Web Services add-in
  • 30. Windows APIs for Web Services  HP Service Test and QTP Web Services Add-in are great solutions for comprehensive Web Services testing. However, the lightweight solution using Windows APIs works perfect in most cases.
  • 31. WinHTTP DLL  Microsoft Windows HTTP Services (WinHTTP) provides developers with a server-supported, high-level interface to the HTTP/1.1 Internet protocol.  WinHTTP WinHttpRequest COM object uses Winhttp.dll
  • 32. WinHttp.WinHttpRequest.5.1 Methods and Properties Methods of WinHttp  Abort: Aborts a WinHTTP Send method.  GetAllResponseHeaders: Retrieves all HTTP response headers.  GetResponseHeader: Retrieves the HTTP response headers.  Open: Opens an HTTP connection to an HTTP resource.  Send: Sends an HTTP request to an HTTP server.  SetAutoLogonPolicy: Sets the current Automatic Logon Policy.  SetClientCertificate: Selects a client certificate to send to a Secure Hypertext Transfer Protocol (HTTPS) server.  SetCredentials: Sets credentials to be used with an HTTP server—either an origin or a proxy server.  SetProxy: Sets proxy server information.  SetRequestHeader: Adds, changes, or deletes an HTTP request header.  SetTimeouts: Specifies, in milliseconds, the individual time-out components of a send/receive operation.  WaitForResponse: Specifies the wait time, in seconds, for an asynchronous Send method to complete, with optional time-out value. Properties of WinHttp  Option: Sets or retrieves a WinHTTP option value.  ResponseBody: Retrieves the response entity body as an array of unsigned bytes.  ResponseStream: Retrieves the response entity body as an IStream.  ResponseText: Retrieves the response entity body as a string.  Status: Retrieves the HTTP status code from the last response.  StatusText: Retrieves HTTP status text.
  • 33. ChangeMetricWeightUnit Web Service on-line http://www.webservicex.net/convertMetricWeight.asmx
  • 36. WinHttp.WinHttpRequest.5.1 snippet ' WinHttp.WinHttpRequest.5.1 Object Set oWinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1") oWinHttpReq.Open "POST", sWebService_Url, False oWinHttpReq.setRequestHeader "Content-Type", sContentType oWinHttpReq.setRequestHeader "SOAPAction", sSOAPAction 'Send SOAP request oWinHttpReq.Send sSOAP_Request 'Get XML Response sXMLResponse = oWinHttpReq.ResponseText
  • 38. Off topic: Using WinHTTP for Web pages
  • 40. Msxml2.DOMDocument  A DOM for XML is an object model that exposes the contents of an XML document  We use the XML DOM by creating an instance of an XML parser  CreateObject(“Msxml2.DOMDocument ”) is the method to create an instance of the Parser object  Msxml2.DOMDocument COM object uses Msxml.dll
  • 43. Msxml2.DOMDocument Code Snippet 'lMsxml2.DOMDocument Set oInputXmlDoc = CreateObject("Msxml2.DOMDocument") 'loadXML from file oInputXmlDoc.load("C:XML_Files_DemoWeight_Conversion.xml") … … 'Send SOAP request oWinHttpReq.Send oInputXmlDoc
  • 44. QTP XML Objects  XMLUtil Object  XMLAttribute Object  XMLAttributesColl Object  XMLData Object  XMLElement Object  XMLElementsColl Object  XMLFile Object  XMLItemColl Object
  • 45. Example: Compare XML files using QTP objects
  • 47. Resources:  MSDN http://msdn.microsoft.com/en-us/library/aa384109  Stefan Thelenius about Software Testing http://abouttesting.blogspot.com  QuickTest Professional Help file
  • 48. Igor Gershovich  E-Mail: igershovich@connectedtesting.com  Phone: 720-933-9395  www.connectedtesting.com