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

Firefox 53 - Selenium 3.4.3 - ActionChains not working #778

Closed
fuuman opened this issue Jun 8, 2017 · 7 comments
Closed

Firefox 53 - Selenium 3.4.3 - ActionChains not working #778

fuuman opened this issue Jun 8, 2017 · 7 comments

Comments

@fuuman
Copy link

fuuman commented Jun 8, 2017

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

Platform and application details

  • Platform: Manjaro
  • Firefox: 53.0.3 (64-bit)
  • Selenium: 3.4.3

Steps to reproduce

from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium import webdriver
profile = webdriver.FirefoxProfile()
caps = DesiredCapabilities.FIREFOX
driver = webdriver.Firefox(capabilities=caps, firefox_profile=profile)
driver.get("about:blank")
ActionChains(driver).key_down(Keys.F12).key_up(Keys.F12).perform()

Result

perform() returns None and there is no open inspector in my Firefox.

@andreastt
Copy link
Contributor

WebDriver is not meant to allow interaction with the browser chrome or the surrounding system widgets (OS), so I would say this is entirely expected behaviour. By pressing F12 like you do, I would expect there to be a keydown and a keyup event for that key, but not for devtools to open.

@fuuman
Copy link
Author

fuuman commented Jun 9, 2017

Why are you talking about chrome? And with Firefox 46 for example, it worked exactly like that to open the Firefox inspector. How I am able to open the inspector then?

@andreastt
Copy link
Contributor

Sorry, the “browser chrome” is the technical term for the UI of a browser.

Firefox 46 was presumably using FirefoxDriver, which was supported by and implemented by the Selenium project. geckodriver is maintained by Mozilla, and is fundamentally different in architecture.

You should not be able to open devtools via geckodriver unless you switch to what’s called ‘chrome context’, but I don’t really know off-hand how to open it from chrome-privileged JS.

@whimboo
Copy link
Collaborator

whimboo commented Jun 16, 2017

To be able to send commands to the chrome scope of Firefox the context has to be switched first. If Python is used as binding you can get some ideas from Foxpuppet: https://github.com/mozilla/FoxPuppet/blob/bd593d59f523a65d67c7630cd34fdbfce688780e/foxpuppet/windows/browser/notifications/base.py#L29.

rigma added a commit to so-green-team/so-green-it that referenced this issue Jan 24, 2018
@java123code
Copy link

This issue is still reproducible for Firefox.

VS 2017 , Selenium v 3.12.1 ,C# , Firefox V 60.0.2 , Chrome V 66 , Nunit v3.10.1 , Gecko Driver v 20.1 , chrome driver v 2.4

I tried to find solution Firefox but did not success but I do get solution for Chrome v66

please provide profile like this : options.AddArguments("--auto-open-devtools-for-tabs");


this is complete chrome driver implementation :

ChromeOptions options = new ChromeOptions();
options.AddArgument("--start-maximized");
options.AddArguments("disable-infobars");
options.AddArguments("--disable-notifications");
options.AddArguments("--auto-open-devtools-for-tabs");
driver = new ChromeDriver(DrivePath, options, TimeSpan.FromSeconds(100));

you may have a look here as well : 

https://peter.sh/experiments/chromium-command-line-switches/

Below commands are NOT working, this is issue with Geckodriver so Gecko team has to provide some solution or fix for that :

driver.FindElement(By.CssSelector("body")).SendKeys(Keys.F12);

Actions action = new Actions(driver); action.SendKeys(Keys.F12); action.Perform();

Actions action = new Actions(driver); action .KeyDown(Keys.Control).SendKeys(Keys.F12).KeyUp(Keys.Control).Perform();

Actions action = new Actions(driver); action.SendKeys(Keys.F12); action.Click();

@whimboo
Copy link
Collaborator

whimboo commented Jun 18, 2018

@java123code please do not cross-post the same question across different issues. As already mentioned on issue #646 your problem is not related to both of these issues.

@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