Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Absent Member.
Absent Member.
5972 views

Execute SQL from a standard WEB vuser

Jump to solution

So yes, LR has custom functions for making connections to a database and running queries and I know there is a suite of database specific vuser types, but I am looking for a solution that allows me to run SQL that can be plugged into a standard web type vuser. I'm sure it's possible; I'm looking for the most elegant way.

 

Basically I want to be able to establish a connection (to Oracle 10g), run some simple SQL, and then parse the results.

 

This is initially for a specific requirement to track the session count but I can straight away see all sorts of benefits to being able to do this.

 

I can also think of some possible solutions, like:

 

Calling out to the command line and doing something there

Running a shell script (via the command line)

Setting up a simple web interface to execute SQL and screen scraping that

 

But this seemed like something that has probably been done many times before so worth a post.

Oliver
Tags (1)
0 Likes
1 Solution

Accepted Solutions
Absent Member.
Absent Member.

Actually - you can manually record the SQL calls with an Oracle 2-Tier virtual user - from behind a sql*plus session...to execute the query and record the calls into that virtual user.

 

Then you can manually merge that script with your web virtual user script.

 

It can be done - I did a presentation back in 1999 on exactly doing this with Web & ODBC.

 

You could also do this with an external program, if that works better for you.

 

-mt

Mark Tomlinson
Performance Testing and Engineering Guru
http://mtomlins.blogspot.com

View solution in original post

5 Replies
Absent Member.
Absent Member.

Actually - you can manually record the SQL calls with an Oracle 2-Tier virtual user - from behind a sql*plus session...to execute the query and record the calls into that virtual user.

 

Then you can manually merge that script with your web virtual user script.

 

It can be done - I did a presentation back in 1999 on exactly doing this with Web & ODBC.

 

You could also do this with an external program, if that works better for you.

 

-mt

Mark Tomlinson
Performance Testing and Engineering Guru
http://mtomlins.blogspot.com

View solution in original post

Absent Member.. Absent Member..
Absent Member..

I am too looking to see if I can run SQL queries from the HTTP/Click and Script protocols but I would be querying SQL Server.   I worked at a previous company where a developer had a Loadrunner script that loaded a dll that had C methods to connect to a database via ODBC and able to do queries.  I don't know if he created that dll or if he found it somewhere online(the developer was no longer at the company when I came in).   Do you all know of such a dll out there?


Thanks,
Ray

0 Likes
Absent Member.. Absent Member..
Absent Member..

Hi Oliver,

 

     I run few Performance Tests in my Org and I have a specific requirement where I have to run a simple SQL query in HTTP/HTMl LR script, the SQL query I wanted to run is just an update query on a simple table.

 

Kindly request you to provide me a script or procedure which I can use to do this, since your question here is also based on the same, kindly let me know if you found a solution and were you able to run the SQL query from LR script

 

With Best Regards

 

0 Likes
Commander
Commander

I require some assistance.

We have a requirement to perform SQL queires in LR, against ODBC. 

The problem I am facing is that we are only licenced to WEB 2.0 protocols, and the application under test is a Client facing UI, so not accessible via Web.

Any suggestions on how this can be done?

0 Likes
Absent Member.. Absent Member..
Absent Member..

Writing SQL statements in vugen is explained in a simple way

 

http://loadrunner95.blogspot.com/2016/10/oracle-database-load-testing.html

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.