Micro Focus QTP (UFT) Forums
QTP and Visual basic - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: QTP and Visual basic (/Thread-QTP-and-Visual-basic)



QTP and Visual basic - Sonia - 03-13-2008

Hi ,

I am using QTP 9.2 with vbscript. However I find that certain functions are required that are created in Visual basic.

Could you tell me how to use Visual basic with QTP 9.2 to create a script that can be run ,

Thank you
Sonia


RE: QTP and Visual basic - Cpt.Zack - 03-15-2008

Most of the vbscript functionalities can be used in QTP 9.2, ONe good way to check if a particular function can be used or not is to run a search on it in the QTP help manual.


RE: QTP and Visual basic - Cpt.Zack - 03-15-2008

One reason why you don't get many replies is because you'r questions don't have much details.It is always a good Idea to include examples and details.Helps us to understand your questione better.


RE: QTP and Visual basic - Sonia - 03-16-2008

Thank you for the reply. I was actually referring to Quality center OTA API functions . I have not yet coded any of them but an example is the Link object function that can link a defect to a test .

Sonia


RE: QTP and Visual basic - Sonia - 03-17-2008

Hi

Below is the code ...........
Code:
Private Sub LinkBugToStep()
    Dim linkF As LinkFactory
    Dim link As link
    Dim ilink As ILinkable
    Dim bugF As BugFactory
    Dim Bug As Bug
    Dim stepsList As list
    Dim runF As RunFactory
    Dim run1 As Run
    Set runF = tdc.RunFactory
    Set run1 = runF.Item(71)
    Dim stepF As StepFactory
    Dim step1 As Step
    Dim filter As TDFilter
    Dim stepList As list
    Set stepF = run1.StepFactory
    Set filter = stepF.filter
    Set stepsList = filter.NewList
    Set step1 = stepsList.Item(1)
    Set bugF = tdc.BugFactory
    Set Bug = bugF.Item(26)
    Set ilink = step1
   Set linkF = ilink.BugLinkFactory
   Set link = linkF.AddItem(Bug)
   link.Post
    ' Disconnect tdc

End Sub
......................

The above is a sample Visual basic function that I need to integrate with QTP scripting so that when the defect(bug) is created it is also linked to the test that created it .
But since VB script is different .. how can I use this function ?

Thank you
Sonia