Question

I've created a JUnit test with WebDriver. It runs perfectly. But when I want to execute it in the Maven context (Integration Server), the perform() method doesn't work.

This perform is to simulate a 'right click':

/**
 * 
 * @param webEl
 *            : WebElement on which you want to click
 * @param nameEl
 *            : String that perfectly matches the name of the option you
 *            want to select
 */
protected void rightClickLink(WebElement webEl, String nameEl) {
    Actions action = new Actions(driver);       
    action.contextClick(webEl).build().perform(); // HERE   
    driver.findElement(By.linkText(nameEl)).click();
}

When I want to build Maven, all it's alright before the line whith the "HERE" comment.

Question 1 : Why running this test on Maven (server) break this code? Question 2 : How can I fix it ?

Was it helpful?

Solution

FIXED !! Ok for people who (maybe) need the answer, be carefull is pretty strange.

I used the WebConsole object. (package Selenium : import com.gargoylesoftware.htmlunit.WebConsole;) to show sentence (like System.out.println()). And the sentences was printed on the screen.

But if I erase all WebConsole opérations, my bug disapear.

So there is a compatibility bug i guess, and it wasn't a problem of wrong code :P

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top