ContextMenu option selection in SWTBOT [message #1860810] |
Mon, 04 September 2023 10:37 |
sruthi yarlagadda Messages: 2 Registered: September 2023 |
Junior Member |
|
|
I have to select one row in the table and perform contextMenu(), on the row and select any option from the menu
public void checkComputeRollup(String Type) throws Exception {
int columnHeaderIndex = getColumnHeaderIndex(TYPE_HEADER);
int rowCount = rowCount();
int weightSolutionIndex = -1;
int rowIndex = FIRST_ROW_NOT_HEADER;
while (weightSolutionIndex == -1 && rowIndex < rowCount) {
String cellValue = getCellDataValueByPosition(rowIndex, columnHeaderIndex);
if (Type.equals(cellValue)) {
weightSolutionIndex = rowIndex;
}
rowIndex++;
}
if (rowIndex == -1) {
throw new IllegalArgumentException("No weight type '" + Type + "' found");
}
rightClick(weightSolutionIndex, columnHeaderIndex).setFocus();
//click(weightSolutionIndex, columnHeaderIndex).setFocus();
Thread.sleep(2000);
// contextMenu(weightSolutionIndex, columnHeaderIndex).setFocus();
contextMenu("Compute Rollup").menu("Compute Rollup").click();
// SWTWorkbenchBot bot = new SWTWorkbenchBot();
// bot.menu("Compute Rollup").click();
Thread.sleep(2000);
}
but it is failing with error message
"org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find pop up menu for control: WeightBookNatTable {*Wrong Thread*} [layout=null]
|
|
|
Powered by
FUDForum. Page generated in 0.03051 seconds