4.2.4.2 Adding support for text retrieval

You can add support for renderers for SWT components or items without the getText() method in order to access text that is otherwise non-readable during test execution.

Use the method "setData(String key, Object value)" on the instance of the component or item whose text you want to access. The key is "TEST_TESTABLE_TEXT"

For example, to access an otherwise unreachable text on a label:
"myLabel.setData("TEST_TESTABLE_TEXT", label);"

If you are making text in e.g. a table accessible, then you will need to add a dynamic part for the column, e.g.:

myTableItemInstance.setData
("TEST_TESTABLE_TEXT_" + colIdx, text);



Copyright BREDEX GmbH 2014. Made available under the Eclipse Public License v1.0.