Jubula RCP Applicaiton - Check Background Color of TableViewer Cell when Row is selected

回眸只為那壹抹淺笑 提交于 2019-12-11 13:02:44

问题


I'm trying to check a background color of a Cell or part of TableViewer's row in an RCP Application using Jubula. Certain columns in a row have their backgrounds colored based on their use in certain data structures.

The application supports selection of the entire row, not a cell, and I would like to check the background color of a specific cell or group of cells in a TableViewer's row, (selected or even unselected).

I can select the row by index and column value based on he column heading string easy enough... but don't know how to check the background color. A slight complication is that when the row is selected the JFace tableviewer changes the color to the default selection color of light blue.

I'm new to Jubula using RCP testing with Eclipse E4 (no 3.x bridge).

I've seen some suggestions about finding the Property and Value of the property, but am not certain how to attain this Property String when the cells are populated by the createColumn() method of a JFace TableViewer. I don't seem to see how to retrieve this specific value from the UI in Jubula.

Any suggestions or directions on how to perform this color check would be helpful and most appreciated. Thank you in advance for your suggestions.

Marv


回答1:


As you said; you have to select the cell with a Test Case (ub_tbl_selectCell for example), then use a ub_tbl_checkPropertyAtMousePosition

PROPERTY_NAME: background
PROPERTY_VALUE: Color {230, 230, 230}
OPERATOR: equals

Make sure you set the Component name at this Test Case too, even though you would expect it to find the Component under the mouse pointer.

The color format is SWT Color's toString() return, so the values respond to the RGB codes.



来源:https://stackoverflow.com/questions/36846463/jubula-rcp-applicaiton-check-background-color-of-tableviewer-cell-when-row-is

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!