Micro Focus QTP (UFT) Forums
QTP C#, get value during test - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: QTP C#, get value during test (/Thread-QTP-C-get-value-during-test)



QTP C#, get value during test - berzek - 07-03-2013

Hello,

I am facing a problem about getting value during my different test.

My goal is to reach values which are input into my combobox, listBox etc.

For that i control QTP in C# and i m able to retrieve the name of all my object in my GUI.

But with the QTP library, i don't know how to get value when for example QTP reach this line in my test :

Code:
SwfWindow("Continent").SwfEditor("Adresse1").Type DataTable("Adr1", dtLocalSheet)

Does anybody have a solution? Smile


RE: QTP C#, get value during test - Ankur - 07-03-2013

If I understood it correct you want to fecth values from a datatable? if yes, it's easy

Code:
var = DataTable("Adr1", dtLocalSheet)

if it's is different actions that you are seeking values go for environment variables.


RE: QTP C#, get value during test - berzek - 07-03-2013

Thanks for answering,

Hum not exactly from a datatable, I dont know if its possible but the best way to solve my problem should be an API who return me in real time my input values ( during my test ) into my C# code for test unit.

Well for example,
in my QTObjectModelLib library ( under VisualStudio) i can return a Dynamic Datatable :

Code:
dynamic dataTable = qtpApp.Test.LastRunResults.DataTable

But AFAIK i can do nothing with it.