anybody give me the real time example for descriptive
programming of web application

Answer Posted / shyam.meghansh

DP is advance topic in QTP. With out loding obj in repo...
we can access them..... this is one of the example for that

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 "shyam_sad"
Browser(BRO).Page(PG).WebEdit(PWD).Set "7shyam"
Browser(BRO).Page(PG).WebButton(Login).Click

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you handle exceptions in qtp?

540


what type of framework u r using in ur organization

1654


What is environment variable in qtp and why to use it?

551


How to get the particular property value?

614


When I click on a link in web page.Link should open in new window.can anyone please let me know the script for this ---Koti

2491






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

1633


Explain the differences between table and db checkpoints?

583


What is synchronization point in QTP?

678


What is recovery scenario manager? When you go for recovery scenario manager?

595


I need to pull the data from the page which in row, column vice into excel sheet, how can it be done using QTP? eg: Name Dept xyz gdty i need the same data to be exported in excel sheet.

1729


What is keyword view in qtp?

554


How the smart identification is used in real time?Please explain with an example

1551


How does qtp identify gui object?

588


How would you export a script from one pc to another in qtp?

663


How many types of run modes are there in qtp?

592