1

我有一个外壳,其中复合材料内有一棵树。我想单击树的特定单元格。当我尝试记录动作时,它没有给出正确的记录,所以我想手动进行。

例如,请查看附加的快照和我要单击的位置。

这是录制后出现的错误

警告:忽略不支持的小部件选择 - 小部件选择事件:null

请帮助我,因为我不擅长 Eclipse,这对我们的项目很重要。非常感谢。

在此处输入图像描述

4

1 回答 1

0

您可以通过编写以下代码在测试代码中手动执行此操作:

// first click on the item to ensure it is visible in the scrolled view
TreeItemLocator itemLocator = new TreeItemLocator("/tree/path/to/File");
getUI().click(itemLocator);

// then you can access the tree cell (columns are zero-based
TreeItemLocator cellLocator = SWTLocators.treeCell(itemLocator.getPath())).at(SWTLocators.column(4);
getUI().click(cellLocator);

当然,您可以import static com.windowtester.runtime.swt.locator.SWTLocators.*使代码更具可读性。

于 2013-07-26T08:16:08.853 回答