Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Advanced UFT 12 for Test Engineers Cookbook
  • Table Of Contents Toc
Advanced UFT 12 for Test Engineers Cookbook

Advanced UFT 12 for Test Engineers Cookbook

4 (3)
close
close
Advanced UFT 12 for Test Engineers Cookbook

Advanced UFT 12 for Test Engineers Cookbook

4 (3)

Overview of this book

This advanced cookbook is designed for software testers and engineers with previous automation experience and teaches UFT (QTP) developers advanced programming approaches. Knowledge of software testing and basic coding (with VBScript in particular) and familiarity with programming concepts are prerequisites.
Table of Contents (13 chapters)
close
close
12
Index

Using SQL queries programmatically

In the previous recipe, we discussed how to use a UFT DB checkpoint. Here, we will show you how to execute a SQL statement using VBScript code.

Getting ready

We will use the function library DB_Func.vbs as in the previous recipe Establishing and closing a database connection.

How to do it...

In our custom class DB_Handler, we will add a new private m_oRecordset field to hold the results of our query and a new method executeSQLQuery(SQLQuery), which, of course, accepts a string with a valid SQL query as the argument:

Private m_oRecordset

function executeSQLQuery(SQLQuery)
    Set m_oRecordset = m_oDBConnection.Execute(SQLQuery)
End Function

Additionally, in our Action1 datasheet, we would call the executeSQLQuery(SQLQuery) method by passing our SQL string as the argument:

call oDBHandler.executeSQLQuery(SQLQuery)

As mentioned earlier, the method would store the returned Recordset in the m_oRecordset field. Then, we will be able to perform operations with these...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Advanced UFT 12 for Test Engineers Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon