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

Cannot read the firefox browser console #549

Closed
puneetkaur11 opened this issue Mar 16, 2017 · 6 comments
Closed

Cannot read the firefox browser console #549

puneetkaur11 opened this issue Mar 16, 2017 · 6 comments

Comments

@puneetkaur11
Copy link

puneetkaur11 commented Mar 16, 2017

In order to help us efficiently investigate your issue, please provide the following information:

Firefox Version

Firefox 52
selenium server 3.3.1
geckodriver 0.15.0

Platform

OSX/Mac 10.11.6

Steps to reproduce -

===================
if(browserType.equals("firefox")){
FirefoxProfile profile=new FirefoxProfile();
profile.setPreference("intl.accept_languages",language);
cap = DesiredCapabilities.firefox();
cap.setCapability(FirefoxDriver.PROFILE, profile);
cap.setCapability("marionette", true);
driver= new RemoteWebDriver(new URL(nodeURL), cap);
s = (String) ((JavascriptExecutor) driver).executeScript("return navigator.userAgent;");

driver.manage().window().maximize();
driver.navigate().to(appURL);

}

@AfterMethod(alwaysRun=true)
public List afterMethod(ITestResult result) throws ExecutionException, Exception {

	if (result.getStatus() == ITestResult.FAILURE) {

		String methodDescription = result.getMethod().getDescription();
		int resultStatus= result.getStatus();

		System.out.println(resultStatus);

		if (resultStatus == 2){
			resultS = "<b>"+"FAILED" + "</b>";
		}

		testCaseResult.add(methodDescription + " : " + "<b>" + "<font color=#ff0000>" +"FAIL" + "</b>");
		LogEntries logs=analyzeLog();

}

public LogEntries analyzeLog() {

	LogEntries logs = driver.manage().logs().get("browser"); // fails here
	for (LogEntry entry : logs) {
	System.out.println(new Date(entry.getTimestamp()) + " " + entry.getLevel() + " " +      entry.getMessage());
	} return logs;
}

ERROR:

========
org.openqa.selenium.UnsupportedCommandException: POST /session/dbd843df-46d0-1f49-8c5e-7d4e690e9a79/log did not match a known command
Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
System info: host: 'MacBook-Pro-4.local', ip: '2601:646:8701:5d50:7c8d:2023:b243:b2e0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{moz:profile=/var/folders/b5/k62v_k1x40l5g6sjcb7hnv040000gp/T/rust_mozprofile.iP1UehkVhzJT, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0, platformVersion=15.6.0, moz:processID=34117, browserName=firefox, platformName=darwin}]
Session ID: dbd843df-46d0-1f49-8c5e-7d4e690e9a79
Command duration or timeout: 66 milliseconds
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

@puneetkaur11 puneetkaur11 reopened this Mar 16, 2017
@puneetkaur11 puneetkaur11 changed the title Cannot Get Console Error Logs from Firefox Cannot read the firefox browser console Mar 16, 2017
@andreastt
Copy link
Contributor

The Selenium log API is not supported by geckodriver.

@arun2003
Copy link

arun2003 commented May 9, 2017

Is this issue fixed? I am also not able to capture console errors from Firefox 53.0.2 (32-bit) using selenium 3.3.0

@andreastt
Copy link
Contributor

@arun2003 The Selenium log API isn’t supported by geckodriver.

@xmo-odoo
Copy link

xmo-odoo commented Mar 5, 2018

@andreastt is there an other tracking bug to follow an eventual implementation of the webdriver/selenium log API?

@andreastt
Copy link
Contributor

@lock
Copy link

lock bot commented Aug 16, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants