Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » getting error for Contextmenu option selection(in a table need to select a row and perform contextmenu() and select the options from that)
getting error for Contextmenu option selection [message #1860811] Mon, 04 September 2023 10:54 Go to next message
sruthi yarlagadda is currently offline sruthi yarlagaddaFriend
Messages: 2
Registered: September 2023
Junior Member
performing rightclick in the table by using ContextMenu() and trying to select the menu options but getting error while performing the below code

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(20000);
}


Output:

org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException: Could not find pop up menu for control: WeightBookNatTable {*Wrong Thread*} [layout=null]
Re: getting error for Contextmenu option selection [message #1860863 is a reply to message #1860811] Wed, 06 September 2023 15:41 Go to previous message
Patrick Tasse is currently offline Patrick TasseFriend
Messages: 85
Registered: July 2009
Member
Hi Sruthi,

Is this code from a subclass of a SWTBot widget? Then what is its base class? Is WeightBookNatTable your own class?

I suspect that the contextMenu() call is not triggering a popup menu to open.

AbstractSWTBot sends a SWT.MenuDetect event to the control, but SWTBotNatTable overrides this to first send a SWT.MouseDown event with button=3.

You might want to try debugging these events in the control to see if it's triggering a menu or why not.

Patrick
Previous Topic:ContextMenu option selection in SWTBOT
Next Topic:Unavailabiltiy of 3.0.0 version
Goto Forum:
  


Current Time: Sat Nov 09 02:25:13 GMT 2024

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

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

Back to the top