Micro Focus QTP (UFT) Forums
How to pass property name in description? - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to pass property name in description? (/Thread-How-to-pass-property-name-in-description)



How to pass property name in description? - Kartikraman - 07-11-2010

I am trying to save image displayed via search in google
I have a problem please tell me how to parameterise the below marked
Iam trying to use myImage as a description object value

Code:
set Images =browser("title:=.* ").page("title:=.*").ChildObjects(odesc)
n= Images.count
For i=0 to 1    
    myImage=Images(i).getroproperty("file name")
    If i=0 Then
    with browser("title:=.* ").page("title:=.*")
    .link("name:=See full size image", "innertext:=See full size image", "innerhtml:=See full size image").Click
    .Image("file name:=[color=#FF0000][b]myImage[/b][/color]").CaptureBitmap "c:\a.bmp"


Advance Thanks
Kartik Raman


RE: How to pass property name in description? - sreekanth chilam - 07-11-2010

Hi Kartik,

FYI, myImage is a 'Variable' not a 'Value' and hence you need to use Concatenation Operators such as '&' while passing a variable.

Go with the below way:

Code:
browser("title:=.* ").page("title:=.*").Image("file name:="&myImage).CaptureBitmap "c:\a.bmp"



RE: How to pass property name in description? - Kartikraman - 07-11-2010

HI,
Thanks for a quick response..
I tried ur solution However it is still not able to recognise to object Please find the error as below:
[attachment=457]

Please help me at the earliest
Thanks in advance
Kartik Raman


RE: How to pass property name in description? - Kartikraman - 07-12-2010

I have tried with this as well
.Image("file name:="&currentimage).CaptureBitmap "c:\a.bmp"


RE: How to pass property name in description? - basanth27 - 07-12-2010

You may need to add additional property other than file name to identify the image. The best way to do it,
1. add the image to the repository.
2. highlight it in the application.
3. Remove all the property except file name.
4. try highlighting again.
5. Now start adding one by one other property begining from index which may uniquely identify that image.