Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » ContextMenu option selection in SWTBOT(unable to select option from contextmenu() inside the table)
ContextMenu option selection in SWTBOT [message #1860810] Mon, 04 September 2023 10:37
sruthi yarlagadda is currently offline sruthi yarlagaddaFriend
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]
Previous Topic:Executing a single SWTbot test from the headless runner
Next Topic:getting error for Contextmenu option selection
Goto Forum:
  


Current Time: Sun Feb 25 23:17:10 GMT 2024

Powered by FUDForum. Page generated in 0.01685 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top