0

I have some selenium tests that work great in Chrome (locally and remotely) but when I run them remotely from my machine to a Windows 2012 VM they can't find any elements AFTER clicking a button to move to the next web page.

Here is a code snippet:

DesiredCapabilities caps = null;
caps = DesiredCapabilities.internetExplorer();
caps.setBrowserName("internet explorer");
caps.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, false);
caps.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
caps.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
caps.setJavascriptEnabled(true);
caps.setPlatform(Platform.WIN8);
String nodeURL = "http://0.0.0.0:5555/wd/hub"
driver = new RemoteWebDriver(new URL(nodeURL), caps);

// IE launches correctly, goes the cart page.  Calculations are done on the pricing, and we click to move to the login page

driver.findElement(By.id("userName")).sendKeys("test@test.com"); 
// ^^ NoSuchElementException: Unable to find element with id == userName

So obviously there is a good connection made. Actions are performed and my tests move from the cart page to the login page. I even added a wait.until, hoping that it was a timing issue, but it timed out after 15 seconds. I'm watching the driver on RDP, it moved to the page. During the 15 seconds, I even opened the dev tools and checked to see if the element was there and it was.

What's going on? Thanks!

JRG
  • 4,037
  • 3
  • 23
  • 34
kroe761
  • 3,296
  • 9
  • 52
  • 81
  • Are you sure the page is done loading by the time you start searching for it? – Moe Ghafari Jul 12 '17 at 18:56
  • Absolutely sure. I added a 15 timeout to be sure. It's not a huge page , just a login intercept for an commerce site. Add a username/password, or continue as guest. Neither button works in IE. – kroe761 Jul 12 '17 at 19:09
  • Can you include your explicit wait statements in your code? Also, out of curiosity, have you tried it with Firefox or Edge? – NotInventedHere Jul 12 '17 at 20:06
  • I figured out what the issue is...see my answer for the annoying solution. – kroe761 Jul 12 '17 at 21:12

1 Answers1

0

Preface: As a QA automation engineer, I hate IE.

It turns out that http://company.com was added a trusted site, but not https://company.com. Once I added that, it started working.

Did I mention I hate IE?

kroe761
  • 3,296
  • 9
  • 52
  • 81