This is a migrated thread and some comments may be shown as answers.

Reading Kendo UI Grid Row Color in TestStudio

3 Answers 166 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
VVP
Top achievements
Rank 2
VVP asked on 18 May 2015, 06:32 AM

Hi,

 

In the application i am testing, there is a Kendo UI grid Row which is highlighted in Red color when some the data entered is not correct.

Can we validate the row color in Test Studio?

In the verification section(Telerik Recorder UI) for that row, I saw "kendo-grid-tt-custom-error k-state-border-down". How ever i am not sure if this is the only info that will be displayed.

 Kindly let me know.

 

Thanks,

VVP

3 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 19 May 2015, 08:00 PM
Hi Vishnu,

Not directly. Test Studio cannot directly test the exact color of any random text on the screen. It can however test what value is set for a property, including properties set via CSS. For example, assume you have HTML like this:
<p><font color="red">This is some text!</font></p>
<p><font color="blue">This is some text!</font></p>

Test Studio can easily verify that the "color" attribute has the value "red" or "blue". As far as Test Studio is concerned "color" is just another named attribute. To Test Studio there's nothing special about the word "color" other than it's the name of an attribute for it to perform a verification of the value of.

You can also use a coded step to validate the CSS computed color like this:
Assert.AreEqual<string>("Red", Pages.ASPNETTreeViewExample.ContentPlaceHolder1RadTreeView1Div.GetComputedStyleValue("Color"));

I hope this helps point you in the right direction.

Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
VVP
Top achievements
Rank 2
answered on 26 May 2015, 04:06 AM

Unforutantely that is not working. I am getting. rgb(0, 63, 89) for all cells.

 Is there any way to check whether a Kendo grid cell is editable or not? I tried Isenabled. But it is always returning true.

0
Cody
Telerik team
answered on 26 May 2015, 09:47 PM
Hello Vishnu,

Another possibility is you need to get the background-color attribute. You should use this when you what the color shading of a UI element or cell. Use "color" when you want to get at the color of the text itself.

You can always use an rgb string as the expected value in the assert:
Assert.AreEqual<string>("rgb(0, 63, 89)", Pages.ASPNETTreeViewExample.ContentPlaceHolder1RadTreeView1Div.GetComputedStyleValue("Color"));

To figure out why it's not working as expected I would need to have a first hand look at your application.

Is there any way to check whether a Kendo grid cell is editable or not? I tried Isenabled. But it is always returning true.

Why do you care? Normally you would just let the test script enter the values needed for the business logic and not worry about testing whether the cell is in edit mode or not.

Anyway, how this is accomplished depends on whether row editing mode is used or cell editing mode is used. You will have to write a line or two of code and test whether or not the right attribute is applied to the right UI element as shown in the attached screen shots.


Regards,
Cody
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
VVP
Top achievements
Rank 2
Answers by
Cody
Telerik team
VVP
Top achievements
Rank 2
Share this question
or