Micro Focus QTP (UFT) Forums
QTP Scripting - 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 Scripting (/Thread-QTP-Scripting--4859)



QTP Scripting - Unleash Rajesh - 05-17-2011

Hi,

Let me know how to write scripts in QTP...! I couldnt find a proper material for web based application to gothrough....!


RE: QTP Scripting - supputuri - 05-17-2011

Please refer to the QTP Help and VB scripting help documents.


RE: QTP Scripting - Anand - 05-18-2011

These help documents you can find in Help folder inside QTP installed folder


RE: QTP Scripting - Unleash Rajesh - 05-19-2011

I want to write scripting of my own without using record and playback...Try to post some codes (For Eg: Login Screen)so that its easy for me to understand and learn with the real time web application..




RE: QTP Scripting - Saket - 05-19-2011

Search this Forum , you will surely get loads of code to refer.


RE: QTP Scripting - Unleash Rajesh - 05-19-2011

Code:
Function Open( )
   dim IE
   set IE   = CreateObject("InternetExplorer.Application")
   IE.visible = true
    IE.stop
   wait(5)
   IE.navigate "http://www.google.com"
   set Open = IE
   Set IE= nothing
End Function

Dim IEexp
set IEexp = Open()

Dim IEobj, obrowser,opage,links,objlink,linkcount
Set IEobj = open()
Set oBrowser= Description.Create()
oBrowser("micclass").Value = "Browser"
set oPage = Description.Create()
oPage("micclass").Value = "page"

set Links = Description.Create()
Links("micclass").Value = "Link"
set objLinks = Browser( oBrowser).Page( oPage).ChildObjects(Links)
LinkCount = objLinks.Count
msgbox LinkCount

For i = 0 To LinkCount-1
set Links = Description.Create()
Links("micclass").Value = "Link"
set objLinks = Browser( oBrowser).Page( oPage).ChildObjects(Links)
objLinks(i).Click
datatable.SetCurrentRow(i+1)
datatable("Lname",global)=Browser( oBrowser).Page(oPage).GetROProperty("href")
Browser(oBrowser).Back
Next...

It throws an error in Lname...Could u plz guide me how to overcm this..is there anything i need to add in the datatable of Expert view.

How i can start learning scripts in QTP...I feel i can go fm the concepts and then to deeper into it...Provide sm materials.....


RE: QTP Scripting - deepaksporty - 05-19-2011

you may also want to know the advanced concepts in vbscripting

follow this link

http://www.advancedqtp.com/knowledge-base/scripting-qtp/

download some chapters there and you're all set...

Disclaimer : you should have some programming background


RE: QTP Scripting - Exception Handling - Unleash Rajesh - 06-09-2011

Exception Handling:
Exception Handling is available in qtp. If u r going to test a scenario first time using qtp how would u know that there will be an exception?....