Skip to content
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

Selenium 3.5.2-Java : getPlatform() method and map.get("platform") method returns different results for capability Platform through geckodriver #4565

Closed
Debanjan-B opened this issue Aug 24, 2017 · 3 comments

Comments

@Debanjan-B
Copy link

Debanjan-B commented Aug 24, 2017

Meta - getPlatform() method and map.get("platform") method returns different results for capability Platform through geckodriver.

cap.getPlatform().toString() returns Platform as XP while map.get("platform") returns Platform as ANY

Through 895 @andreastt confirmed it's a Java Client issue.

OS: Windows 8 Pro, 64 bit

Selenium Version: 3.5.2 (Java)

Selenium Binding: Java

GeckoDriver Version: 0.18.0

Browser: Mozilla Firefox

Browser Version: 55.0.2

Expected Behavior - getPlatform() method and map.get("platform") method should return same result for capability Platform through geckodriver.

Actual Behavior - getPlatform() method and map.get("platform") method returns different results for capability Platform through geckodriver.

Steps to reproduce -

Minimal Code Block:

package demo;

import java.util.Map;

import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.RemoteWebDriver;

public class WEBDRIVER_Platform
{
	public static void main(String[] args) 
	{
		String attribute = "platform";
		System.setProperty("webdriver.gecko.driver", "C:\\Utility\\BrowserDrivers\\geckodriver.exe");
		WebDriver driver = new FirefoxDriver();
		Capabilities cap = ((RemoteWebDriver) driver).getCapabilities();
		System.out.println("Platform is : "+cap.getPlatform().toString());
		Map<String, ?> map = cap.asMap();
		Object value = map.get(attribute);
		System.out.println("Key : " + attribute + " Value : "+ value);
	}
}

Console Output:

Platform is : XP
Key : platform Value : ANY
@barancev
Copy link
Member

mozilla/geckodriver#902

@barancev
Copy link
Member

Appears to be a client side issue, reopening.

@barancev barancev reopened this Aug 24, 2017
@Debanjan-B
Copy link
Author

Debanjan-B commented Aug 24, 2017

@barancev I am sorry, I think initially I tagged a wrong issue reference from the geckodriver queue in the description. Now corrected it. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants