Skip to content

Selenium 3.5.3-Java-IEDriverServer 3.5.1 : 'platformName' attribute returns "XP" where as W3C Specs mentions either "linux", "mac" or "windows" #4669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Debanjan-B opened this issue Sep 9, 2017 · 3 comments
Labels
C-java Java Bindings D-IE

Comments

@Debanjan-B
Copy link

Selenium 3.5.3-Java-IEDriverServer 3.5.1 : platformName attribute returns XP where as W3C Specs mentions either linux, mac or windows

W3C Specs mentions the following:

In chapter 7. Capabilities, section 7.2 Processing Capabilities:

windows

where as IEDriverServer 3.5.1 returns XP

As per #4526 and this comment latest IEDriverServer is w3c compatible. But seems out of sync.

Meta -

OS: Windows 8 Pro, 64 bit
Selenium Version: 3.5.3
Browser: Internet Explorer
Browser Version: 10.0 (64-bit)

Expected Behavior - platformName attribute should return either linux, mac or windows

Actual Behavior - platformName attribute returns XP

Steps to reproduce -

Minimal Code Block :

import java.util.Map;

import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.RemoteWebDriver;

public class WEBDRIVER_platformName
{
	public static void main(String[] args) 
	{
		String attribute = "platformName";
		System.setProperty("webdriver.ie.driver", "C:\\Utility\\BrowserDrivers\\IEDriverServer.exe");
		WebDriver driver =  new InternetExplorerDriver();
                Capabilities cap = ((RemoteWebDriver) driver).getCapabilities();
                Map<String, ?> map = cap.asMap();
                Object value = map.get(attribute);
                System.out.println("Key : " + attribute + " Value :"+ value);
               driver.quit();
 	}
}

Console Output :
Key : platformName Value :XP

@lmtierney
Copy link
Member

That list is not final, it is an example. It even states in the spec:

This list is not exhaustive.

When returning capabilities from New Session, it is valid to return a more specific platformName, allowing users to correctly identify the Operating System the WebDriver implementation is running on.

@Debanjan-B
Copy link
Author

Thanks @lmtierney But either way I think there is something wrong in the method calls because, while I execute this scenario on WIN8 system the Java client is picking up XP, which is not correct. Where as Java Client intelligence does differentiates between Platform.WINDOWS, Platform.WIN8, Platform.WIN8_1 and Platform.WIN10

capability

@lmtierney lmtierney reopened this Sep 11, 2017
@lmtierney lmtierney added B-grid Everything grid and server related C-java Java Bindings D-IE and removed B-grid Everything grid and server related labels Sep 11, 2017
@barancev
Copy link
Member

Selenium Grid uses platformName capability to find the best node for a new session.

Concrete drivers (like InternetExplorerDriver or FirefoxDriver) simply ignore this capability. They run a browser on the local machine, no matter what the current platform is.

platformName capability returned by a driver in the response to a new session request is totally unrelated to platformName capability passed to the driver constructor.

But, yes, XP is a wrong answer. It should be WINDOWS.

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-java Java Bindings D-IE
Projects
None yet
Development

No branches or pull requests

3 participants