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

Test Case not running on FF 54.0 & 55.0 with Selenoid #198

Closed
anujitas opened this issue Aug 24, 2017 · 25 comments
Closed

Test Case not running on FF 54.0 & 55.0 with Selenoid #198

anujitas opened this issue Aug 24, 2017 · 25 comments
Milestone

Comments

@anujitas
Copy link

Selenoid: 1.3.5

When I am running my Test Case on FF 54.0 or 55.0 , its showing error ===
enable vnc was not a the name of a known capability or a valid extension capability

Now, after seeing this, if I remove the enableVNC cap, its showing error ===
version was not a the name of a known capability or a valid extension capability

When I marked the default browser in my browser.json file FF 54.0, and only passing "Browser" in my Test Case, its running smoothly. Same works with FF 55.0 too.

The same code is working fine till FF 52.0. Its only crying with FF 54.0 & 55.0.

Not sure, what is the issue, Please provide some updates on this.

@vania-pooh vania-pooh added this to the 1.3.6 milestone Aug 24, 2017
@vania-pooh
Copy link
Member

@Infobeans-Anujita this is because in FF53+ images we use Selenoid proxying directly to Geckodriver. In earlier images we use Selenium server. Let me try to reproduce this.

@vania-pooh
Copy link
Member

@Infobeans-Anujita the message you are seeing comes from Geckodriver binary - just checked it. Then I tried to take screenshot with selenium-python 3.5.0, selenoid 1.3.5 and the following code:

from selenium import webdriver

capabilities = {
    "platform": "LINUX",
    "browserName": "firefox",
    "version": "55.0",
    "enableVNC": True
}

driver = webdriver.Remote(
    desired_capabilities=capabilities,
    command_executor='http://selenoid-host.example.com:4444/wd/hub'
)
try:
    driver.get('http://duckduckgo.com')
    driver.get_screenshot_as_file('screenshot.png')
except Exception as e:
    print(e)
finally:
    driver.quit()

Works like a charm. Works with no issues with my Java test using 3.4.0 client too. I think this a Python-specific issue. Any more details?

@anujitas
Copy link
Author

@vania-pooh Thanks for the quick response !!!
Can you please check what is your default browser in your browsers.json file.

When I am executing my test case on FF 54.0 & 55.0 when it is saved as default browser, the test case successfully runs. But if not saved as default, it cries.

Any Updates on this?

@vania-pooh
Copy link
Member

@Infobeans-Anujita default is 55.0. I used cm to generate config file - it always using the latest version as the default.

@anujitas
Copy link
Author

I am using docker for selenoid & selenoid-UI. And specified many browsers of FF like 46.0, 52.0, 54.0 & 55.0. Its running till 52.0. But not greater than that.

@vania-pooh
Copy link
Member

@Infobeans-Anujita please provide more details about your python-selenium version. I tested with 3.5.0 and Python 2.7.10.

@anujitas
Copy link
Author

@vania-pooh selenium: 3.4.3
python: 2.7.6

@vania-pooh
Copy link
Member

@Infobeans-Anujita please try to update to 3.5.0.

@vania-pooh
Copy link
Member

@Infobeans-Anujita this should be resoved, right?

@anujitas anujitas closed this as completed Sep 4, 2017
@ilya-edrets
Copy link

Hi, I've run into the same problem.
Firefox > 52.0 throws an error 'enableVNC was not a the name of a known capability or a valid extension capability'.
I use C# for tests:

var firefoxOptions = new FirefoxOptions();
firefoxOptions.AddAdditionalCapability("version", "55.0", true);
firefoxOptions.AddAdditionalCapability("enableVNC", true, true);
new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), firefoxOptions);

I use selenoid 1.3.7

My Firefox section in browser.json created by cm:

"55.0": {
	"image": "selenoid/vnc:firefox_55.0",
	"port": "4444",
	"path": "/wd/hub",
	"tmpfs": {
		"/tmp": "size=128m"
	}
}

@vania-pooh
Copy link
Member

@ElijahCapricorn these options should be passed via DesiredCapabilities:

final DesiredCapabilities caps = new DesiredCapabilities("firefox", "55.0", Platform.LINUX);
caps.setCapability("enableVNC", true);

This is more generic approach that using FirefoxOptions.

@ilya-edrets
Copy link

@vania-pooh I tried this way also. But it doesn't resolve the problem.

@c0dehu1k
Copy link

c0dehu1k commented Oct 16, 2017

@ElijahCapricorn I am assuming you are using Selenoid firefox images, Please remove the older image of FireFox55 and get the new one. Also update Selenium Java libraries to latest.

@ilya-edrets
Copy link

@ersuniljoshi I executed these commands:

docker rmi selenoid/vnc:firefox_55.0
docker pull selenoid/vnc:firefox_55.0

The webdriver is still throwing the error.

@vania-pooh
Copy link
Member

@ElijahCapricorn please specify your Selenium client version then.

@c0dehu1k
Copy link

@ElijahCapricorn I have faced exactly the same problem in python, there is surely an issue with Selenium Client libraries you are using. We have upgraded our client libraries to Selenium==3.5.0 and everything started working like charm.

@vania-pooh
Copy link
Member

@ersuniljoshi I tested with Java client 3.4.0 as well as 3.6.0 - everything works.

@ilya-edrets
Copy link

@vania-pooh I tried to use Selenium 3.5.2 and 3.6.0. The problem is reproduced on both versions.
It's look like a bug in a dotnet version of Selenium.

@ilya-edrets
Copy link

@vania-pooh @ersuniljoshi I've made some researches.
I run a docker container with selenoid/vnc:firefox_55.0. Then, i started the geckodriver inside the container
/usr/bin/geckodriver --host :: --log debug --port=40983
Then, I started to capture http messages between Selenium and the geckodriver.

serverDEBUG->POST/session
{
	"desiredCapabilities": {
		"browserName": "firefox",
		"version": "55.0",
		"platform": "ANY",
		"enableVNC": true
	},
	"capabilities": {
		"firstMatch": [{
			"browserName": "firefox",
			"enableVNC": true
		}]
	}
	
}
serverDEBUG<-400BadRequest
{
	"value": {
		"error": "invalid argument",
		"message": "enableVNC was not a the name of a known capability or a valid extension capability",
		"stacktrace": "stack backtrace:
		0:           0x5787ed - backtrace::backtrace::trace::h59229d13f6a8837d
		1:           0x578942 - backtrace::capture::Backtrace::new::h23089c033eded8f0
		2:           0x4463cc - webdriver::error::WebDriverError::new::hd11f864b1fdf4510
		3:           0x440eef - <core::iter::Map<I, F> as core::iter::iterator::Iterator>::next::h4f3cf544297176b2
		4:           0x44baa3 - geckodriver::marionette::MarionetteHandler::create_connection::h6f7058fccafe4367
		5:           0x425c32 - <webdriver::server::Dispatcher<T, U>>::run::h8f5348b8f5f7c053
		6:           0x40b22c - std::panicking::try::do_call::hb67c6fb6bcd96195
		7:           0x5dc20a - panic_unwind::__rust_maybe_catch_panic
								at /checkout/src/libpanic_unwind/lib.rs:98
		8:           0x41b943 - <F as alloc::boxed::FnBox<A>>::call_box::h4100941edc372034
		9:           0x5d48a4 - alloc::boxed::{{impl}}::call_once<(),()>
								at /checkout/src/liballoc/boxed.rs:650\n - std::sys_common::thread::start_thread
								at /checkout/src/libstd/sys_common/thread.rs:21\n - std::sys::imp::thread::{{impl}}::new::thread_start
								at /checkout/src/libstd/sys/unix/thread.rs:84"
	}
} 

It also reproduced when I send the POST request on http://localhost:40983/session using tools like postman.
Maybe this information helps to resolve the problem.

@vania-pooh
Copy link
Member

And here is what Java client sends:

POST /wd/hub/session HTTP/1.1[\r][\n]"
Content-Type: application/json; charset=utf-8[\r][\n]"
Content-Length: 463[\r][\n]"
Host: localhost:4444[\r][\n]"
Connection: Keep-Alive[\r][\n]"
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_144)[\r][\n]"
Accept-Encoding: gzip,deflate[\r][\n]"
[\r][\n]"
{[\n]"
  "desiredCapabilities": {[\n]"
    "enableVNC": true,[\n]"
    "browserName": "firefox",[\n]"
    "version": "56.0",[\n]"
    "platform": "LINUX"[\n]"
  },[\n]"
  "requiredCapabilities": {},[\n]"
  "capabilities": {[\n]"
    "desiredCapabilities": {[\n]"
      "enableVNC": true,[\n]"
      "browserName": "firefox",[\n]"
      "version": "56.0",[\n]"
      "platform": "LINUX"[\n]"
    },[\n]"
    "requiredCapabilities": {},[\n]"
    "alwaysMatch": {},[\n]"
    "firstMatch": [[\n]"
      {[\n]"
        "browserName": "firefox"[\n]"
      }[\n]"
    ][\n]"
  }[\n]"
}"

Notice the difference in firstMatch section. I think this is the real cause of the problem.

@ilya-edrets
Copy link

@vania-pooh Yes, you are right. I checked sources of Selenium for dotnet. And I found that all values for a capability section are copied from desiredCapability. Only 'Version' and 'Platform' not copied.
So, as a workaround, I created derived class and override this logic:

public class SelenoidWebDriver : RemoteWebDriver
{
    protected override Dictionary<string, object> GetCapabilitiesDictionary(ICapabilities capabilitiesToConvert)
    {
        var result = base.GetCapabilitiesDictionary(capabilitiesToConvert);
        if (result.ContainsKey("enableVNC"))
        {
            result.Remove("enableVNC");
        }

        return result;
    }

    /*
        contructors implementation
    */
}

@vania-pooh
Copy link
Member

@ElijahCapricorn does it work now with this workaround?

@ilya-edrets
Copy link

@vania-pooh yes. I've tested it with Firefox 52.0 and 55.0 using selenium 3.5.0 and 3.6.0.

@vania-pooh
Copy link
Member

@ElijahCapricorn you could create an issue for Selenium C# client because this error is returned by Geckodriver - Selenoid only proxies it.

@ilya-edrets
Copy link

@vania-pooh I will try)

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

No branches or pull requests

4 participants