SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Junior Member
    Join Date
    Jul 2007
    Location
    USA
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    CurrentStyle(color) for Win Objects

    Attached is the screenshot of the window with ListItems I need to identify color

    For Windows application I need to identify the color of the text as different color signifies different status and based on color I need to automate.

    I think Object.Currentstyle.color is not supported for Windows Applciation.I receive the following error message

    error Message :Object doesn't support this property or method: 'Window(...).WinObject(...).Object'.

    Any ideas on this one?
    Attached Images Attached Images

  2. #2
    Advanced Member Anshoo Arora's Avatar
    Join Date
    Oct 2007
    Location
    New Delhi, India
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    What type of application is it? Why does QTP see the target object as a WinObject? I'm not sure if QTP sees the object as a WinObject will it be possible for it to retrieve its properties.
    Regards,

    Anshoo Arora
    Relevant Codes

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Location
    USA
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    Its a Windows Application,
    objecs are identified as Window().WinObject()
    (WinObject can be WinEdit, WinList,WinButton etc)

    For any object I am receiving the same error as mentioned earlier.When I spy I couldn't find any properties that give the value of color.

  4. #4
    Advanced Member Anshoo Arora's Avatar
    Join Date
    Oct 2007
    Location
    New Delhi, India
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    [ QUOTE ]
    objecs are identified as Window().WinObject()


    [/ QUOTE ]
    As I said in my previous post, I'm not sure how much you will be able to achieve if QTP sees the target objects as WinObjects. I doubt this is going to be possible.. Anyhow, just for trial/error, can you see if the following works:

    MsgBox Window().WinObject().GetROProperty("BackColor")
    MsgBox Window().WinObject().GetROProperty("ForeColor")
    Regards,

    Anshoo Arora
    Relevant Codes

  5. #5
    Junior Member
    Join Date
    Jul 2007
    Location
    USA
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    Nope...I tried "backcolor" and "forecolor". blank result.

    Not only WinObject but for all objects (WinButton,WinList,WinEdit..) I am receiving same error.
    Eg:

    I tried the following

    Set winObj = Window("Pickup Call").WinButton("3pty Contact / Spec Instr")
    Set winObj = winObj.Object
    scolor = winObj.currentStyle.color

    but I get the error stating WinObj.Object property is not supported..

  6. #6
    Advanced Member Anshoo Arora's Avatar
    Join Date
    Oct 2007
    Location
    New Delhi, India
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    You cannot use .Object for Windows applications..
    Regards,

    Anshoo Arora
    Relevant Codes

  7. #7
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,555
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    Right, can't use .Object. You're pretty much limited to the properties/methods you can see with the Object Spy.

  8. #8
    Junior Member
    Join Date
    Jul 2007
    Location
    USA
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    Thanks for the confirmation guys! Even I was expecting the same.
    None of the object spy properties help me in identifying color.
    My Testcase says select the line with <color> eg: purple
    I am not sure how I can do this. I am looking for any alternative/workaround to accomplish the task.

    I really appreciate any useful idea!

  9. #9
    Super Member FredMan's Avatar
    Join Date
    Oct 2007
    Location
    Lenexa, Kansas
    Posts
    1,218
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    Is this a .Net application?
    Onward thru the fog...

  10. #10
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,555
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: CurrentStyle(color) for Win Objects

    May need to look into a different tool.

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 9.68%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:52 AM.

Copyright BetaSoft Inc.