Highlighted
Respected Contributor.
Respected Contributor.
249 views

UFT with Database integration

Hello guys 

I need advice about uft connection with database. Case is: 1. make any transaction in web application 2. copies value while test running in web application 3. then opens plsqldev.exe 4. open new sql window 5. writes any query using above value 6. run it 7. checks table 

1. I think all these actions can be performed by using *devicereplay* objects and *systemutil* command? please see my question named UFT 14.03 

2. Make a database connection

What do you think about 1st way guys? pls share your experience 

thanks,

Gan-Orgil 

0 Likes
2 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Hi,

Why would you want to run your queries in a seperate application instead of running them through the UFT using database connection strings..?
Example: (oracle db)
 Opening the connection the database in the correct environment and opening a recordset
        Set objDB = CreateObject ("ADODB.Connection")
        objDB.Open ("Driver={Microsoft ODBC for Oracle}; Server = "& dB_ENV &";Uid= " & dB_Usr &"; Pwd = " & dB_Pswd & ";")
        set recordset = CreateObject ("ADODB.Recordset")  
        On error resume next
        ' run the query and disable the error control
        set recordset = objDB.execute(dB_Query)

Do Until recordset.EOF         

    <code to loop through your query results>

Loop
     

Makes sense to you ?

 

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Addinf to Liorde's great post you also need to have an ODBC driver installed.

Mark Smith.

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.