Closed Bug 1217988 Opened 10 years ago Closed 10 years ago

platformName capability reports compile system's OS name instead of effective, local system name

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(firefox45 fixed)

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: joshin4colours, Assigned: ato)

References

(Blocks 1 open bug)

Details

(Keywords: pi-marionette-server)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:44.0) Gecko/20100101 Firefox/44.0 Build ID: 20151019030227 Steps to reproduce: Using Selenium WebDriver 2.48.2 with Wires 0.4.2 on a Win 7 machine and Java bindings (Oracle JDK 1.8.0_11) I ran the following code: ------------------------------------ public class MarionetteTest { WebDriver _driver; private final String URL = "https://the-internet.herokuapp.com"; @BeforeClass(alwaysRun = true) public void setUpBeforeClass() { _driver = new MarionetteDriver(); } /** * Setup method for each test method. * Creates two random accounts (not added) and goes to GLAccounts Page. */ @BeforeMethod(alwaysRun = true) public void setUp() { _driver.navigate().to(this.URL); } /** * Teardown method for each test method. Attempts to log out of Collaborate. */ @AfterMethod(alwaysRun = true) public void tearDown() { _driver.manage().deleteAllCookies(); _driver.navigate().refresh(); } /** * Base teardown method for TOTG Tax test class. */ @AfterClass(alwaysRun = true) public void tearDownAfterClassCollaborate() { _driver.quit(); } @Test public void openTheInternet() { Assert.assertTrue(_driver.findElement(By.xpath(".//a[@href='https://github.com/tourdedave/the-internet']")).isDisplayed()); } } Actual results: The tests failed at the @BeforeClass step of staring a new MarionetteDriver instance with the following stack trace: FAILED CONFIGURATION: @BeforeClass setUpBeforeClass org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06' System info: host: 'GRANT7', ip: '192.168.214.56', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_11' Driver info: driver.version: MarionetteDriver at org.openqa.selenium.firefox.internal.Executable.<init>(Executable.java:75) at org.openqa.selenium.firefox.GeckoDriverService$Builder.createArgs(GeckoDriverService.java:93) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:299) at org.openqa.selenium.firefox.MarionetteDriver.setupService(MarionetteDriver.java:99) at org.openqa.selenium.firefox.MarionetteDriver.<init>(MarionetteDriver.java:71) at org.openqa.selenium.firefox.MarionetteDriver.<init>(MarionetteDriver.java:45) at com.caseware.commons.client.smauto.test.marionette.MarionetteTest.setUpBeforeClass(MarionetteTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:359) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312) at org.testng.SuiteRunner.run(SuiteRunner.java:261) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:112) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:176) Expected results: The code should've executed as written with the MarionetteDriver creating a new instance and preferably successfully completing the given @Test methods. Furthermore, there appears to be a discrepancy in these lines: org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06' System info: host: 'GRANT7', ip: '192.168.214.56', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_11'
As far as I can tell WebDriver leaves the platformName capabilities to be implementation defined in https://w3c.github.io/webdriver/webdriver-spec.html#dfn-processing-capabilities. This means Marionette is conformant. We get the OS value from Services.jsm's appinfo property, which is documented in nsIXULRuntime.idl ( https://dxr.mozilla.org/mozilla-central/source/xpcom/system/nsIXULRuntime.idl?from=xpcom%2Fsystem%2FnsIXULRuntime.idl#41) to be: * A string tag identifying the current operating system. This is taken * from the OS_TARGET configure variable. It will always be available. I imagine OS_TARGET is set by the machine that compiled your binary, which would be a Windows 7 machine, rather than your local system's actual computed OS. It may be that what we want to look at is the "appVersion" or "oscpu" system properties described in https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/NsIPropertyBag.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: webdriver
Summary: Marionette Incorrectly Identifies Win7 As Vista → platformName capability reports compile system's OS name instead of effective, local system name
OS: Unspecified → All
Hardware: Unspecified → All
Bug 1217988: Use current system OS for platformName capability Services.appinfo is populated by the target compile system's OS name, taken from the OS_TARGET configure variable. By using Services.sysinfo instead, we are returning the effective current local system's operating system, which is similar to what is found in Gecko's UA string. r=dburns
Attachment #8685464 - Flags: review?(dburns)
Comment on attachment 8685464 [details] MozReview Request: Bug 1217988: Use current system OS for platformName capability Review request updated; see interdiff: https://reviewboard.mozilla.org/r/24793/diff/1-2/
Assignee: nobody → ato
Status: NEW → ASSIGNED
Comment on attachment 8685464 [details] MozReview Request: Bug 1217988: Use current system OS for platformName capability https://reviewboard.mozilla.org/r/24793/#review22355
Attachment #8685464 - Flags: review?(dburns) → review+
After discussion with :ato, I used the Firefox build from the installer from Treeherder here: http://archive.mozilla.org/pub/firefox/try-builds/bind-autoland@mozilla.com-e765987f3004ae3c5691fee31bbc15562bac8baf/try-win64/ The WebDriverException above "org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA" is no longer being thrown. All OS related values appear to be correct for the given platform. However I'm still getting a UnreachableBrowserException despite Firefox being invoked.
Comment on attachment 8685464 [details] MozReview Request: Bug 1217988: Use current system OS for platformName capability Review request updated; see interdiff: https://reviewboard.mozilla.org/r/24793/diff/1-2/
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Depends on: 1225180
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: