-
Notifications
You must be signed in to change notification settings - Fork 61
Xebium contextmenu #115
Comments
With thanks to jguglielmi I have a custom fixture in SeleniumDriverFixture.java. Just throwing ex in the catch context doesn't work. Maven won't build that. private String executeCommand(final ExtendedSeleniumCommand command, final String[] values, long delay) {
....
// --START [17/03/2014 - tombeuckelaere]--
if ("contextMenu".equals(command.getSeleniumCommand())) {
try {
WebElement webElement = getWebDriver().findElement(By.xpath(values[0]));
new Actions(getWebDriver()).contextClick(webElement).perform();
LOG.info("Performing | contextMenu | " + values[0] + " | " );
}
catch (Exception e) {
LOG.error("contextMenu command interrupted", e);
}
return null;
}
// --END [17/03/2014 - tombeuckelaere]--
....
} |
Ok, after looking around for a day (and 5 minutes after posting the above), the code below is the working version of the contextmenu. Concrete basic usage in fitnesse: Maybe this command can be added to the standard package of xebium? Update 20/03/2014 Contextmenu and you wish to get the clicked elements id Contextmenu and you don't wish to get the clicked elements id // --START [17/03/2014 - tombeuckelaere]--
if ("contextMenu".equals(command.getSeleniumCommand())) {
try {
WebElement webElement = getWebDriver().findElement(By.xpath(values[0]));
new Actions(getWebDriver()).contextClick(webElement).perform();
LOG.info("Performing | contextMenu | " + values[0] + " | " );
output= webElement.getAttribute("id");
LOG.info("Performing | contextMenu | " + values[0] + " | element id is " + output );
}
catch (final SeleniumException e) {
output = "Execution of command contextMenu failed: " + e.getMessage();
LOG.error(output);
}
return output;
}
// --END [17/03/2014 - tombeuckelaere]-- |
Tom, the contextMenu is directly in seleniumdriverfixture.java and not a custom fixture. You can view my pull request...#122 You can add css, id, or any other implementation you'd like. We(@ejakubowski and I) are preferable to xpath. We trained our testers in it because we also use SynthUse for thick client testing. Users of our own medicine. :) |
So can you close this? |
This is good stuff by the way Tom. Can you fork OASIS and submit this over as a pull request? Also do the same for Xebium. I don't want to take credit for your efforts. http://github.com/jguglielmi/OASIS |
I have made a pull request in relation to this issue here. |
Related to this problem (#57) I still can't open the context menu with xebium.
jguglielmi stated this can be solved by writing a custom fixture. However I don't have the knowledge to do this.
Can you provide me instructions so I can fix this?
We are in urgent need for a working context menu command.
The text was updated successfully, but these errors were encountered: