Marionnete driver - Firefox is not reacting on screen

505 views
Skip to first unread message

Nir Pinchas

unread,
Jun 7, 2016, 8:19:48 AM6/7/16
to Selenium Users
Hello guys .
I am trying to run firefox 46/7 via Marionnete driver.
I ran it and the browser loads , but when I send actions to the driver like navigate etc, nothing seems to happen on the screen..
for example - 
I ran:

_driver = new MarionetteDriver(dc);
_driver.navigate().to("http://www.drp.co.il");
String x = _driver.getCurrentUrl();

x returns "http://www.drp.co.il" , but the actual browser stays on the initial browser page , it doesnt really navigates !!
What am I doing wrong?
Thank you

*I use the latest "wire.exe"  v0.7.1

⇜Krishnan Mahadevan⇝

unread,
Jun 7, 2016, 9:49:53 PM6/7/16
to Selenium Users
What does the wires log say ?

I tried recreating your issue and am not able to. FWIW I am running on a MAC and am on Selenium 2.53.0 using wires 0.7.1.

Here's the chatty logs from wires, when I ran a simple test on FF 46.0.1.

1465350176246 Marionette DEBUG Marionette enabled via build flag and pref
1465350176428 Marionette INFO Listening on port 2828
1465350176972 Marionette DEBUG Marionette enabled via command-line flag
1465350177119 Marionette DEBUG Accepted connection conn0 from 127.0.0.1:49884
1465350177205 Marionette TRACE conn0 -> [0,1,"newSession",{"capabilities":null,"sessionId":null}]
1465350177206 Marionette CONFIG Changing capabilities: {"browserName":"Firefox","browserVersion":"46.0.1","platformName":"Darwin","platformVersion":"15.5.0","specificationLevel":"1","raisesAccessibilityExceptions":false,"rotatable":false,"acceptSslCerts":false,"takesElementScreenshot":true,"takesScreenshot":true,"proxy":{},"platform":"DARWIN","XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","appBuildId":"20160502172042","device":"desktop","version":"46.0.1"}
1465350178733 Marionette DEBUG loaded listener.js
1465350178739 Marionette DEBUG loaded listener.js
1465350178832 Marionette TRACE conn0 <- [1,1,null,{"sessionId":"9d389201-9fde-344c-9d48-99bb6bcc11ab","capabilities":{"browserName":"Firefox","browserVersion":"46.0.1","platformName":"Darwin","platformVersion":"15.5.0","specificationLevel":"1","raisesAccessibilityExceptions":false,"rotatable":false,"acceptSslCerts":false,"takesElementScreenshot":true,"takesScreenshot":true,"proxy":{},"platform":"DARWIN","XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","appBuildId":"20160502172042","device":"desktop","version":"46.0.1"}}]
1465350178877 Marionette TRACE conn0 -> [0,2,"get",{"url":"http://the-internet.herokuapp.com/"}]
1465350183917 Marionette TRACE conn0 <- [1,2,null,{}]
Hello world
1465350183925 Marionette TRACE conn0 -> [0,3,"deleteSession",{}]
1465350183927 Marionette TRACE conn0 <- [1,3,null,{}]

Process finished with exit code 0


After that I upgraded firefox to 47 and re-ran the test. Here are the logs.

1465350434134 Marionette DEBUG Marionette enabled via build flag and pref
1465350434306 Marionette INFO Listening on port 2828
1465350434751 Marionette DEBUG Marionette enabled via command-line flag
1465350434875 Marionette DEBUG Accepted connection conn0 from 127.0.0.1:49997
1465350434924 Marionette TRACE conn0 -> [0,1,"newSession",{"capabilities":null,"sessionId":null}]
1465350434925 Marionette CONFIG Changing capabilities: {"browserName":"Firefox","browserVersion":"47.0","platformName":"Darwin","platformVersion":"15.5.0","specificationLevel":0,"raisesAccessibilityExceptions":false,"rotatable":false,"acceptSslCerts":false,"takesElementScreenshot":true,"takesScreenshot":true,"proxy":{},"platform":"DARWIN","XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","appBuildId":"20160604131506","device":"desktop","version":"47.0"}
1465350435878 Marionette DEBUG loaded listener.js
1465350435882 Marionette DEBUG loaded listener.js
1465350436102 Marionette TRACE conn0 <- [1,1,null,{"sessionId":"13ede6ef-e352-bc40-a1b4-50c373aab29e","capabilities":{"browserName":"Firefox","browserVersion":"47.0","platformName":"Darwin","platformVersion":"15.5.0","specificationLevel":0,"raisesAccessibilityExceptions":false,"rotatable":false,"acceptSslCerts":false,"takesElementScreenshot":true,"takesScreenshot":true,"proxy":{},"platform":"DARWIN","XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","appBuildId":"20160604131506","device":"desktop","version":"47.0","command_id":1}}]
1465350436247 Marionette TRACE conn0 -> [0,2,"get",{"url":"http://the-internet.herokuapp.com/"}]
1465350439715 Marionette TRACE conn0 <- [1,2,null,{}]
Hello world
1465350439722 Marionette TRACE conn0 -> [0,3,"deleteSession",{}]
1465350439729 Marionette TRACE conn0 <- [1,3,null,{}]

Process finished with exit code 0

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/88734b31-a738-451c-af76-853db721ddc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nir Pinchas

unread,
Jun 8, 2016, 3:13:03 AM6/8/16
to Selenium Users
hello Krishnan,
I just restarted my computer and it seems like the navigation problem was solved somehow , but I have another problem - it seems like the JavascriptExecutor of the driver doesnt work on the main page. For example , I have a var on the page called num - the JavascriptExecutor  claims it is undefined..
I ran this code - 

DesiredCapabilities dc = DesiredCapabilities.firefox();
OSUtils.setSystemProperty("webdriver.firefox.bin", new File(TestConfig.getInstance().get("BrowserPath")).getAbsolutePath());
OSUtils.setSystemProperty("webdriver.gecko.driver",PathConfig.getInstance().resolve("drivers","wires.exe"));
_driver = new MarionetteDriver(dc);
_driver.navigate().to("https://yahoo.com");
String url = _driver.getCurrentUrl();
JavascriptExecutor jx = (JavascriptExecutor) _driver;
Object varNum = jx.executeScript("return num;");
(I added the num var manually through the browser console after navigation).

the output is:

1465369799895 Marionette DEBUG Marionette enabled via build flag and pref
1465369800100 Marionette INFO Listening on port 2828
1465369800599 Marionette DEBUG Accepted connection conn0 from 127.0.0.1:58061
1465369800612 Marionette TRACE conn0 -> [0,1,"newSession",{"capabilities":null,"sessionId":null}]
1465369800613 Marionette CONFIG Changing capabilities: {"browserName":"Firefox","browserVersion":"46.0.1","platformName":"Windows_NT","platformVersion":"6.1","specificationLevel":"1","raisesAccessibilityExceptions":false,"rotatable":false,"acceptSslCerts":false,"takesElementScreenshot":true,"takesScreenshot":true,"proxy":{},"platform":"WINDOWS_NT","XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","appBuildId":"20160502172042","device":"desktop","version":"46.0.1"}
1465369801175 Marionette DEBUG loaded listener.js
1465369801179 Marionette DEBUG loaded listener.js
1465369801287 Marionette TRACE conn0 <- [1,1,null,{"sessionId":"c819e795-3c39-41dc-a8ea-c16b91010919","capabilities":{"browserName":"Firefox","browserVersion":"46.0.1","platformName":"Windows_NT","platformVersion":"6.1","specificationLevel":"1","raisesAccessibilityExceptions":false,"rotatable":false,"acceptSslCerts":false,"takesElementScreenshot":true,"takesScreenshot":true,"proxy":{},"platform":"WINDOWS_NT","XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","appBuildId":"20160502172042","device":"desktop","version":"46.0.1"}}]
1465369801354 Marionette TRACE conn0 -> [0,2,"get",{"url":"https://yahoo.com"}]
1465369806116 Marionette TRACE conn0 <- [1,2,null,{}]
1465369806133 Marionette TRACE conn0 -> [0,3,"getCurrentUrl",{}]
1465369806135 Marionette TRACE conn0 <- [1,3,null,{"value":"https://www.yahoo.com/"}]
JavaScript warning: https://normandy.cdn.mozilla.net/static/js/bundles/selfrepair-7575f6d27445b45bcffb.js, line 9825: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
1465369824809 Marionette TRACE conn0 -> [0,4,"executeScript",{"args":[],"newSandbox":false,"script":"return num;","scriptTimeout":null,"specialPowers":false}]
1465369824814 Marionette TRACE conn0 <- [1,4,{"error":"javascript error","message":"ReferenceError: num is not defined","stacktrace":"execute_script\ninline javascript, line 0\nsrc: \"var __marionetteFunc = function(){return num;};__marionetteFunc.apply(null, __marionetteParams);\"\nStack:\n__marionetteFunc@dummy file:0:35\n@dummy file:0:52\n"},null]

Thank you!

Nir Pinchas

unread,
Jun 8, 2016, 3:25:37 AM6/8/16
to Selenium Users
About the navigation problem - 
It happened because there was another session of firefox open , and the driver opened a new session but then started communicate with the old one ! it seems like a bug isnt it?

⇜Krishnan Mahadevan⇝

unread,
Jun 8, 2016, 10:56:50 AM6/8/16
to Selenium Users
@Nir,


sounds like support for Javascript execution is marked complete. So it should work.

Can you please share a sample test which injects a variable via javascript and then later uses the same javascript to read the value..so that I can use it to see if I can find out anything additional.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Nir Pinchas

unread,
Jun 9, 2016, 4:26:11 AM6/9/16
to Selenium Users
Hi Krishnan ,
If I am adding the var by myself before trying to return its value it works fine. I am talking about vars that are already exist on the page.
For example please run this test: (The var 'gadgets' exists in google page by default).
 This code throws an error so you can try it: (if youll remove the comment from "gadgets = 123;" it works fine..)

@Test
public void test1() throws Exception{
WebDriver _driver; 
DesiredCapabilities dc = DesiredCapabilities.firefox();
OSUtils.setSystemProperty("webdriver.firefox.bin", "C:\\FirefoxOfficial\\firefox.exe");
OSUtils.setSystemProperty("webdriver.gecko.driver","C:\\Wires\\wires.exe");
_driver = new MarionetteDriver(dc);
_driver.navigate().to("https://www.google.com/");
Thread.sleep(2000);
JavascriptExecutor jx = (JavascriptExecutor) _driver;
//jx.executeScript("gadgets = 123;");
Object varNum = jx.executeScript("return gadgets;");
System.out.println(varNum);
}



org.openqa.selenium.WebDriverException: ReferenceError: gadgets is not defined (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 35 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 17:01:03'
System info: host: 'WALKME200', ip: '192.168.3.155', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_71'
Driver info: org.openqa.selenium.firefox.MarionetteDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20160502172042, version=46.0.1, platform=XP, proxy={}, specificationLevel=1, acceptSslCerts=false, browserVersion=46.0.1, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=Windows_NT, device=desktop}]
Session ID: 397e956c-6a77-4dc3-865c-c3e1f6e76854
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:575)

This is the driver`s log:

1465460585734 Marionette DEBUG Marionette enabled via build flag and pref
1465460585932 Marionette INFO Listening on port 2828
1465460586433 Marionette DEBUG Accepted connection conn0 from 127.0.0.1:62380
1465460586446 Marionette TRACE conn0 -> [0,1,"newSession",{"capabilities":null,"sessionId":null}]
1465460586448 Marionette CONFIG Changing capabilities: {"browserName":"Firefox","browserVersion":"46.0.1","platformName":"Windows_NT","platformVersion":"6.1","specificationLevel":"1","raisesAccessibilityExceptions":false,"rotatable":false,"acceptSslCerts":false,"takesElementScreenshot":true,"takesScreenshot":true,"proxy":{},"platform":"WINDOWS_NT","XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","appBuildId":"20160502172042","device":"desktop","version":"46.0.1"}
1465460586980 Marionette DEBUG loaded listener.js
1465460586984 Marionette DEBUG loaded listener.js
1465460587090 Marionette TRACE conn0 <- [1,1,null,{"sessionId":"15d1b671-ef2a-4e02-b801-a2c3f806fe2f","capabilities":{"browserName":"Firefox","browserVersion":"46.0.1","platformName":"Windows_NT","platformVersion":"6.1","specificationLevel":"1","raisesAccessibilityExceptions":false,"rotatable":false,"acceptSslCerts":false,"takesElementScreenshot":true,"takesScreenshot":true,"proxy":{},"platform":"WINDOWS_NT","XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","appBuildId":"20160502172042","device":"desktop","version":"46.0.1"}}]
1465460587135 Marionette TRACE conn0 -> [0,2,"get",{"url":"https://www.google.com/"}]
1465460588996 Marionette TRACE conn0 <- [1,2,null,{}]
JavaScript warning: https://normandy.cdn.mozilla.net/static/js/bundles/selfrepair-7575f6d27445b45bcffb.js, line 9825: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
1465460593616 Marionette TRACE conn0 -> [0,3,"executeScript",{"args":[],"newSandbox":false,"script":"return gadgets;","scriptTimeout":null,"specialPowers":false}]
1465460593619 Marionette TRACE conn0 <- [1,3,{"error":"javascript error","message":"ReferenceError: gadgets is not defined","stacktrace":"execute_script\ninline javascript, line 0\nsrc: \"var __marionetteFunc = function(){return gadgets;};__marionetteFunc.apply(null, __marionetteParams);\"\nStack:\n__marionetteFunc@dummy file:0:35\n@dummy file:0:56\n"},null]


It happens on every page and every var I tried , not only on google...
Thank you !!!

⇜Krishnan Mahadevan⇝

unread,
Jun 9, 2016, 4:41:28 AM6/9/16
to Selenium Users
Just curious : Do you see the same behavior with the other drivers such as InternetExplorerDriver and ChromeDriver ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Nir Pinchas

unread,
Jun 9, 2016, 4:50:17 AM6/9/16
to Selenium Users
Not at all,  it also works fine with the good old firefoxDriver.

please run this piece of code and you can see it works flawlessly :
@Test
public void test2() throws Exception{
WebDriver _driver; 
DesiredCapabilities dc = DesiredCapabilities.firefox();
OSUtils.setSystemProperty("webdriver.ie.driver", "C:\\Projects\\walkme.automation\\Project.Core\\external\\selenium_drivers\\IEDriverServer.exe");
//OSUtils.setSystemProperty("webdriver.gecko.driver","C:\\Wires\\wires.exe");
_driver = new InternetExplorerDriver();
_driver.navigate().to("https://www.google.com/");
Thread.sleep(2000);
JavascriptExecutor jx = (JavascriptExecutor) _driver;
//jx.executeScript("gadgets = 123;");
Object varNum = jx.executeScript("return gadgets;");
System.out.println(varNum);
}


⇜Krishnan Mahadevan⇝

unread,
Jun 9, 2016, 4:59:20 AM6/9/16
to Selenium Users

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Nir Pinchas

unread,
Jun 9, 2016, 5:13:41 AM6/9/16
to Selenium Users

Andreas Tolfsen

unread,
Jun 9, 2016, 7:46:31 AM6/9/16
to seleniu...@googlegroups.com
Nir Pinchas <ni...@walkme.com> writes:

> I am trying to run firefox 46/7 via Marionnete driver. I ran it
> and the browser loads , but when I send actions to the driver like
> navigate etc, nothing seems to happen on the screen.. for example - I
> ran:
>
> _driver = new MarionetteDriver(dc );
> _driver.navigate().to("http://www.drp.co.il" String x = );
> _driver.getCurrentUrl( );
>
> x returns "http://www.drp.co.il" , but the actual browser stays on the
> initial browser page ,* it doesnt really navigates !!*

Based on this information it’s really hard to figure out what’s
wrong.

Generally I would advise you to use Firefox Nightly when experimenting
with Marionette since it has many bug fixes and features that are not
available in Firefox 46/47.

You can download nightly builds from https://nightly.mozilla.org.

Andreas Tolfsen

unread,
Jun 9, 2016, 7:49:29 AM6/9/16
to seleniu...@googlegroups.com
Nir Pinchas <ni...@walkme.com> writes:

> I just restarted my computer and it seems like the navigation problem
> was solved somehow , but I have another problem - it seems like the
> JavascriptExecutor of the driver doesnt work on the main page. For
> example , I have a var on the page called num - the JavascriptExecutor
> claims it is undefined..

This is a known problem in stable Firefox to do with how scripts
are evaluated inside immutable sandboxes. The problem was fixed in
https://bugzilla.mozilla.org/show_bug.cgi?id=1123506, which was uplifted
to Firefox 48 only yesterday.

I’d recommend you to try this again using Firefox Nightly.

Andreas Tolfsen

unread,
Jun 9, 2016, 7:52:38 AM6/9/16
to seleniu...@googlegroups.com
⇜Krishnan Mahadevan⇝ <krishnan.ma...@gmail.com> writes:

> Looking at this page :
> https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriv
> er/status

Hm. I’m sad to say that this document isn’t entirely truthful with
respect to the current status of things in Marionette.

⇜Krishnan Mahadevan⇝

unread,
Jun 9, 2016, 8:02:51 AM6/9/16
to Selenium Users
Yikes.. I didn't know that... But thanks for letting me know of it Andreas...

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

Andreas Tolfsen

unread,
Jun 9, 2016, 9:22:23 AM6/9/16
to seleniu...@googlegroups.com
⇜Krishnan Mahadevan⇝ <krishnan.ma...@gmail.com> writes:

> On Thu, Jun 9, 2016 at 5:22 PM, Andreas Tolfsen <a...@mozilla.com>
> wrote:
>
> > ⇜Krishnan Mahadevan⇝ <krishnan.ma...@gmail.com> writes:
> >
> > > Looking at this page :
> > > https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/Web
> > > Driv er/status
> >
> > Hm. I’m sad to say that this document isn’t entirely truthful
> > with respect to the current status of things in Marionette.
>
> Yikes.. I didn't know that... But thanks for letting me know of it
> Andreas...

I’m doing the work to update it now.

Sandeep Jain

unread,
Jun 23, 2016, 2:13:30 PM6/23/16
to Selenium Users
Did anyone come across the following issue:

Script:
System.setProperty("webdriver.gecko.driver", "C:\\Users\\jains13\\Downloads\\wires-0.6.2-win\\wires-0.6.2-win.exe");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
driver = new MarionetteDriver(capabilities);
driver.get("https://cacert.org");
Thread.sleep(5000);
driver.quit();
driver.close();

1. FF 47, sel 2.52.0 jar file,marionette jar v0.6.0  ran the above simple script, it works fine.
2.  FF 47, sel 2.52.0 jar file,marionette jar v0.8.0, throws exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
3.  FF 47, sel 2.52.0 jar file,marionette jar v0.7.1, fails too.
It seems to be working only on v0.6.2 on FF 47.

Am i missing something or is it a known issue ?
Reply all
Reply to author
Forward
0 new messages