Webdriver does not find elements in remote IE

I have a strange problem with webdriver. I have a local environment and a remote environment to run my tests; they work fine in Firefox in both environments, but with Internet Explorer 8 they only work on the local computer.

Whenever I run tests with a remote server, it doesn’t even find the text field elements for login. I use wait when searching for items, and I tried to increase the time to minutes, but nothing. I see an element in IE, looking at the source code. I even compared the html generated from both of them, and the same one.

I use selenium through JBehave (JBehave-web-selenium-3.3.4 with selenium-ie-driver-2.0b3)

To get the item I'm using:

public WebElement getElementById(String elementId){ return getMyWaiter() .waitForMe(By.id(elementId), TEST_DELAY_IN_S); } public WebElement waitForMe(By locator, int timeout) { WebDriverWait wait = new WebDriverWait(driver, timeout); return wait.until(Waiter.presenceOfElementLocated(locator)); } public static Function<WebDriver, WebElement> presenceOfElementLocated( final By locator) { return new Function<WebDriver, WebElement>() { @Override public WebElement apply(WebDriver driver) { return driver.findElement(locator); } }; } 

Any idea why the different behavior?

+4
source share
2 answers

I found a problem, it is a security problem with Internet Explorer and remote servers. To fix this, simply add the remote server to trusted sites ( Tools > Options > Security Tab > Trusted Site )

+11
source

It works for. In IE, go to Internet Option β†’ Security β†’ Uncheck Enable Protected Mode for all tabs. And restart your project

0
source

All Articles