Selenium Grid causing issue to execute tests in IE and Chrome

694 views
Skip to first unread message

SeleniumMember

unread,
Jul 13, 2015, 11:49:21 AM7/13/15
to seleniu...@googlegroups.com
Hi all,

I am currently working on writing tests in Selenium WebDriver in Java using JUnit and TestNG(Proof of Concept). Last week, I was testing Selenium Grid and I set my Local machine as a Hub. Since, then I am NOT able to Execute test in Chrome and Internet Explorer 11. I have driver files set in correct locations and system Properties are set correctly as well.

System.setProperty("webdriver.chrome.driver", "C://chrome//ChromeDriver.exe");
System.setProperty("webdriver.ie.driver", "C://intenetexplorer//ChromeDriver.exe")

The following error is what I am getting on both browsers. Has anyone run into this error after testing Selenium Grid? I would like to revert the Selenium Grid test, may be that will solve this issue, not sure.

Chrome -
Starting ChromeDriver 2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3) on port 41986
Only local connections are allowed.

Internet Explorer - I  have set Protected Mode Settings selected for Internet and Intranet.
org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)

Any help would be great. I am goggling as this moment for solution.

Thanks

Shawn McCarthy

unread,
Jul 13, 2015, 12:03:38 PM7/13/15
to seleniu...@googlegroups.com
When you are running your tests against a Selenium Grid (even if its a local selenium grid), you need to set the webdriver.chrome.driver and webdriver.ie.driver properties when starting the nodes. You don't need to set those properties in your code that is running the tests when running against the selenium grid. So something like :

java -jar selenium-server-standalone.jar -Dwebdriver.chrome.driver="C:/chromedriver.exe" -Dwebdriver.ie.driver="C:/IEDriverServer.exe"

Hope this helps!

SeleniumMember

unread,
Jul 13, 2015, 2:54:26 PM7/13/15
to seleniu...@googlegroups.com
Thanks for your reply Shawn.

I tried Selenium Grid just to test how it works, I ran into issue with Firefox crashing so right now, I am NOT using Selenium Grid.

Instead I am trying to run my tests from Eclipse in IE, Chrome and FF. I Enabled the Protected Mode Settings for all options under Security, so I am not getting the error below.
org.openqa.selenium.remote.
SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)

However, now I have a different issue.
IE11 opens in "http://localhost:36420/" and message displays "This is the initial start page for the WebDriver server."

Chrome - Starting ChromeDriver 2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3) on port 41986
Only local connections are allowed.

Any clue how to fix this issue in IE and also in Chrome.

Thanks

Shawn McCarthy

unread,
Jul 13, 2015, 8:45:58 PM7/13/15
to seleniu...@googlegroups.com
Those messages from IEDriver and chromedriver are expected.  Are you seeing things not working ? Or maybe a real error message?

SeleniumMember

unread,
Jul 14, 2015, 10:33:29 AM7/14/15
to seleniu...@googlegroups.com
Initially, I had those error kept coming up and no test would run.

Now, I am running into different issue. My test is supposed to login to the web-based application and then navigate through multiple pages.

Right now, my test logins to the web-based application and after that, it keeps complaining the object is not found. I am using xpath and css to identify the objects. The same thing works in Firefox.

org.openqa.selenium.NoSuchElementException: Unable to find element with xpath == //div[@class='category'][text()='System Dashboards'] (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 285 milliseconds


Thanks

On Monday, July 13, 2015 at 10:49:21 AM UTC-5, SeleniumMember wrote:

Mercious

unread,
Jul 15, 2015, 5:09:30 AM7/15/15
to seleniu...@googlegroups.com
You are most likely running into issues regarding the Internet Explorer Driver and it's faulties.

The driver cannot properly detect if page loading is going on or not. It often fails.

So in your case it might be that selenium logs into the page and while the page that appears after login is being loaded, selenium tries locating the element.
But since the page is still under construction, the element cannot be found.

The solution is to use explicit waits or maybe a sleep.

Another possibility is that you ran into xpath issues. Its not a consistent and guaranteed notation. Browsers might imlement it in a different way.

Always us xpath as last resort. In your case, maybe the classname is unique and you can use By.className instead?


SeleniumMember

unread,
Jul 15, 2015, 8:50:40 AM7/15/15
to seleniu...@googlegroups.com
Thank you for your reply.

I am very new to CSS. I did start with locating element by CSS, however I wasn't able to get the text inside a div, so I started using the mixture of css and xpath. Following are the examples of the text I was trying to get.

<div class="category">Dashboards One</div> ,
<li class=""category"> <Div> Settings One</div><li/>

Thanks

On Monday, July 13, 2015 at 10:49:21 AM UTC-5, SeleniumMember wrote:

Mercious

unread,
Jul 15, 2015, 10:22:41 AM7/15/15
to seleniu...@googlegroups.com
Before we evaluate what a different approach would be to select the element ... Read what i wrote first and test if that is your problem.

Add a wait or whatever. Watch the test and look when and where the exception is thrown. 

SeleniumMember

unread,
Jul 15, 2015, 11:02:00 AM7/15/15
to seleniu...@googlegroups.com
Yes they have a common class and I tried using the class. However, I do Not know the way to click the text.

I tried using "wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//li[@class='category']//following::li[@class='link']/a[text()='Widget']")));

At least I saw it ran fine on IE11.

Thanks

On Monday, July 13, 2015 at 10:49:21 AM UTC-5, SeleniumMember wrote:

Mercious

unread,
Jul 16, 2015, 4:06:49 AM7/16/15
to seleniu...@googlegroups.com
Ehm ... So is it working now or .. ?

SeleniumMember

unread,
Jul 16, 2015, 5:02:13 PM7/16/15
to seleniu...@googlegroups.com
Yes, it worked on IE. I have yet to test on Chrome. Hopefully it will work for Chrome as well.

Thanks

On Monday, July 13, 2015 at 10:49:21 AM UTC-5, SeleniumMember wrote:
Reply all
Reply to author
Forward
0 new messages