take one example and write vbscript on one web application
in qtp?
explian descriptive programe with one example?

Answer Posted / shyam.meghansh

Example for VB Script

Function fib(n)

Dim fab(70)

fab(0)=0
fab(1)=1

For j=2 to n

fab(j)=fab(j-1)+ fab(j-2)

Next

For i=0 to n-1

msgbox fab(i)
Next

end function


Next Save this function in .vbs file and call the function
in QTP Action

Example for Descriptive Programme

systemutil.Run("http://www.rediffmail.com")

set BRO =Description.Create()
BRO("title").Value = "Welcome to Rediff.com India"
BRO("name").value ="Welcome to Rediff.com India"
BRO("openedbytestingtool").value= true


Set PG =Description.Create()
PG("title").value="Welcome to Rediff.com India"
PG("url").value="http://www.rediff.com/index.html"

Set UN =Description.Create()
UN("name").value= "login"
UN("Class Name").value ="WebEdit"
UN("type").value= "text"
UN("html tag").value="INPUT"

Set PWD =Description.Create()
PWD("name").value ="passwd"
PWD("Class Name").value="WebEdit"
PWD("type").value="password"
PWD("html tag").value="INPUT"

Set Login =Description.Create()
Login("name").value ="Go"
Login("Class Name").value="WebButton"
Login("type").value="submit"
Login("html tag").value="INPUT"
Login("value").value="GO"
Login("class").value="rmailgobtn"

temp= Browser("Welcome to Rediff.com").Page("Welcome to
Rediff.com").WebElement("ShockwaveFlash1").Exist
If temp= true Then
'Browser("Welcome to Rediff.com").Page("Welcome to
Rediff.com").WebElement("ShockwaveFlash1").
End If


Browser(BRO).Page(PG).WebEdit(UN).Set "testingwithshyam"
Browser(BRO).Page(PG).WebEdit(PWD).Set "shyamshyam"
Browser(BRO).Page(PG).WebButton(Login).Click





..................... Any More Querys mail to
testingwithshyam@gmail.com

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to recognise the webelement and verifying that webelement is enabled?

1630


What is the difference between keyword view and expert view?

595


Why qtp the best testing tool?

556


Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.

1546


Tell me about qtp?

533






Connect to QC using AOM.

1223


What is the extension of the recovery scenario file in qtp?

529


can test automation improve test effectiveness?

1476


Define Error Pane of UFT?

682


How you can find length of array in qtp?

531


In an interview, what r the general questions asked in QTP? pls give me anwser to this question?

1413


What is fragmentation and paging?

1582


Hi All, issue is related to handling pop up script generated in IE, and run on mozilla. In App Under Test, when we get the alert pop ups, we just click ok button. if we need to run the same code on mozilla it will not identify . so we will check browser if browser(*).dialog(IE object).exits browser(*).dialog(IE object).winbutton(OK).click else 'by default mozilla browser(*).dialog(mozilla object).page(*).webbutton(OK).CLICK END IF But my qustion is. Do we write the above piece of code where ever we get such kind of pop ups from the application like alert pop up, confirmation pop up.... OR do we have any other alternative way to do this by using any functions in Recovery Scebarios? If Any of u know idea please do help me in this regard. or send answer to kravimb@gmail.com

1411


Hi.. I want to do parametrization for selecting perticular flighr say XYZ by using local table: criteria: 1.If flight is available msgbox "Flight is available" and then select flight from flight table and click to ok button after that as enter username and ticket no and then stop 2. otherwise msgbox " Flight is not available" and stop Please help me out ..and let me know your responses on dipak.bachhav@gmail.com Regard, Dipak

1608


Which features or drawbacks of QTP lead to the upgrade for a newer version?

561