also, i tried to use the solution given but it is not working
I am using wpf application (windows based). 
GetROWColor(i) and getRowSelection(i) are not working (error: object 
doesn't support this method). pls let me know the solution for this..
 
Regards
 

On Monday, September 3, 2012 2:11:24 PM UTC+5:30, shilpa gupta wrote:

> HI Bhavin
>  
> Thanks for your reply
>  
> The color is shown in the property 'Background' which is under Native 
> Proeprties (in object spy). how can this be retrieved. I am using 
> WpfWindow("title").WpfButton("title").Object.Background. It is not giving 
> the answer
>  
> Regards
>
> On Monday, September 3, 2012 2:25:01 AM UTC+5:30, bhavin v patel wrote:
>
>> You need to know about 'GetROProperty'/loop/conditional statement.  
>>
>> First , Spy (guy with hat) of any object you would to get property of.. 
>> in case it is color, and rowcount/itemcount/rows 
>>
>> So when you spy of any object; you will get two values for native and 
>> application properties name and their values. 
>>
>> Color object may have name as 'ffffff' which is html translation of white 
>> color. (here is html translation of colors  
>> http://www.w3schools.com/html/html_colornames.asp ) 
>>
>> myColor=Window(x).WinButton(y).GetROProperty("Color/look for name of 
>> property") 
>>
>> here you can use if.else or select case statement to select color based 
>> html code .
>>
>> if (myColor="ffffff") then myColor="White" ...so forth 
>>
>> 2.you can also use 'GetRoProeprty' to get num row for any table. 
>>
>> rowCount= Window(x).WinTable(y).GetROProperty("rows/look for name of 
>> property") or RowCount 
>>
>> Note: You need to find property which give "true" or "false" based on 
>> rowselection. I m just gueessing getRowSelection ( attach screen shot,if u 
>> cant find it) 
>> for i=0 to rowCount-1 
>>    rowActivated= Window(x).WinTable(y).getRowSelection(i)
>>    if (rowActivated="True") then 
>>
>>    messagebox "In table row num "&i&" is activated" 
>>     myRowColor=Window(x).WinTable(y).GetROWColor(i)     
>>    End IF 
>>    ' Note: I have guessed those two properties and methods , you can find 
>> it in spy.
>> Next 
>>
>> some methods and proeprties are not set so you may need to talk to 
>> developer to make available for testing. 
>>
>> Good luck 
>>
>>
>>
>> On Sunday, September 2, 2012 7:11:29 AM UTC-4, shilpa gupta wrote:
>>>
>>> Hi friends
>>>
>>> I am new member of the group, have below queries for QTP 11, windows 
>>> based application:
>>>
>>> 1. want to know how to find the color of any object (button etc) in 
>>> windows based application, i searched and found the methods for web based 
>>> application but not for windows based
>>> 2. in a windows application, there is a table (having multiple rows and 
>>> columns). i want to know the row which is selected (highlighted) , how can 
>>> this be done
>>> 3. and also on selecting any row in the table, the color of the selected 
>>> row changes. how can we get the color of the selected row
>>>
>>> please reply
>>>
>>> Regards
>>>
>>

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to