Hi,
I would like to run a test that tracks after some icon for a time period of one hour.
What I need to track in that hour is the color changes of this element and to see the changes in the log report at the end of the test.
So how should I do it? By code writing or if there's any other way?
A code example will be very helpful.
I've added a snapshot of the relevant element.
Thanks.
Element colour attribute tracking
Element colour attribute tracking
You do not have the required permissions to view the files attached to this post.
Re: Element colour attribute tracking
Hi,
I'm afraid, you forgot to mention, which icon exactly do you want to validate/track? Could you please provide an xpath of the element in question?
In any case, you will most probably have to use some custom code to track the color changes? Most probably obtaining a certain pixel and validate its color value? I believe there were discussed some pixel validation techniques in the past? Check for example this post:
https://www.ranorex.com/forum/can-i-che ... tml#p37084
I'm afraid, you forgot to mention, which icon exactly do you want to validate/track? Could you please provide an xpath of the element in question?
In any case, you will most probably have to use some custom code to track the color changes? Most probably obtaining a certain pixel and validate its color value? I believe there were discussed some pixel validation techniques in the past? Check for example this post:
https://www.ranorex.com/forum/can-i-che ... tml#p37084
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Element colour attribute tracking
Well, I see two easy ways to approach this. The first is by using the Get Value action, storing the pulled value in a var and doing something with that var like print it to the report. If you prefer to work in code, you could easily achieve the same thing with something like below:
The above code snippet will loop 3600 times (this is how many seconds are in an hour) and will print the current color. I would recommend only printing the color to the report if the color has changed since the last check as this will currently print 3600 times to the report.... it is a bit much but this is just an example. Alternatively, you could also adjust the delay to check once a minute / every 10 minutes / etc. Really depends on your specific scenario
Code: Select all
for (int i = 0, i < 3600; i++)
{
Report.Info("Current color is: " + <element>.GetAttributeValue("<attribute name for color>").ToString());
Delay.Seconds(1);
}