Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
descriptive programming- object description
#1
Not Solved
hi,

I am new to descriptive programming and I am looking at the qtp function of one of my colleges.

There are 2 buttons called Save and Cancel. In his code he has written
.WebButton(CancelTop).click. But when i checked the object with the object spy, it showed different names: Its html id =btnCancel, name and value =Cancel and type = Cancel.

How can you create user defined names for objects on a web page?

Thanks

Nicey
Reply
#2
Not Solved
Hi
I think you will find information about descriptive programming in this forum, as it is discussed earlier.
For this scenario, You can write the DP as below
'Describe button as:
Code:
set oCancel=Description.Create
oCancel("micclass").Value="WebButton"
oCancel("name").Value="Cancel"
oCancel("value").Value="Cancel"
oCancel("html id").Value="btnCancel"
Set WebEdits=Browser().Page().ChildObjects(oCancel)
'Now Click on that button
WebEdits(0).Click
Reply
#3
Not Solved
Thanks for the response Kavitha!

I figured that using the above code a user can click the cancel buttons on a web page based on the index provided.

But in the code i am reviewing, it doesn't have any object creation code anywhere in the test as well as in the associated function (vbs) files.
My colleague has used the With .. End With statement within which he uses .WebButton(CancelTop).Click. Can we make use of parameters to create an object name?
Reply
#4
Not Solved
Hi Nicey,
If i understand your query properly,
1. Please look into the Object Repository of your test for Object 'CancelTop'
I believe this is the logical name of the object.

2. With .. End With is used to Executes a series of statements on a single object.

There is no descriptive programming used
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dynamic descriptive Programming issue in Terminal Emulator cprasad 1 1,997 04-25-2019, 08:17 PM
Last Post: Ankur
  UFT Tool support with Descriptive programming laks 1 1,843 07-05-2018, 05:31 PM
Last Post: Ankur
  UFT Descriptive Programming objects not identified in a secure & private intranet env bugfinder2 1 1,890 06-07-2017, 01:41 PM
Last Post: Ankur
  UFT descriptive programming Browser("creationtime:=-1") not always working SOUMYADEEP 0 3,116 01-20-2017, 01:53 AM
Last Post: SOUMYADEEP
  Inserting variable values into Descriptive Programming Functions eske99 2 3,569 12-18-2015, 01:47 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)