Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to validate color of image object in a web page
#1
Exclamation 
Hi

I need to validate the color of some image objects inside a web page. We have red,green,yellow etc . These colors are pointing towards some live status. So it will come dynamically. I need to check which color is coming.

Please find the attachment.

Can anyone pls help me here? Thanks

Regards
Vivek


Attached Files Image(s)
   
Reply
#2
Hi,

Try to use DOM..it will help u.

Regards,
Sankalp
Reply
#3
Hi Sankalp,
I have no idea how to use DOM.. I have not done it before. Can you please help me.?

Regards
Vivek
Reply
#4
Hi,
I have 1 doubt, did these are images of different color or there is one object whose color will get changed as per status.

if color is changing then u can refer the below code:

Code:
Set ctrlWebEl = Browser("Welcome to Gmail").Page("Welcome to Gmail").WebElement("Welcome to Gmail") Set objWebEl = ctrlWebEl.Object sColor = objWebEl.currentStyle.color 'or u can use sBackgrColor = objWebEl.currentStyle.backgroundColor

if these are different objects of different color then add these objects in OR with unique properties and use if conditions to identify which object is displayed and proceed further.

Regards,
Sankalp
Reply
#5
Hi Sankalp,

Yes these are different objects of different color and these are present inside a webtable. And the rows of webtable will also change dynamically.

Thanks
Vivek
Reply
#6
It will be helpful if u provide snapshot of ur application
Reply
#7
Hi,

I think if these are different objects then add them in OR and proceed further using loops and conditions.

Let me know in case of any help required.

Regards,
Sankalp
Reply
#8
Thanks a lot sankalp!!
I will try this and come back if I have any doubts
Reply
#9
Always there 2 help u out. Wink

Regards,
Sankalp
Reply
#10
Let me know if this works for you --
Sometimes when the object have color..Their runtime property text ..might have color in it -
e.g. Green color object might have runtime text Name_GRN

This had worked for me.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can QTP handle slick grid table in a web page qtplearner88 2 5,242 10-01-2019, 10:44 AM
Last Post: shilpi952
  Child Object Not able to identified in Web Menu Link noor 0 2,233 01-21-2018, 04:44 PM
Last Post: noor
  DP Web Browser/Page issues rstimers 1 2,934 08-14-2015, 12:37 PM
Last Post: venkatesh9032
  webfile web object not identified at runtime in a java application saila123 1 3,318 02-11-2015, 08:23 PM
Last Post: Kirill
  How to validate a format of an alphanumeric string PrateepKaraval 2 6,848 11-08-2014, 10:26 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)