-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
send_keys doesn't work for key combinations in geckodriver 0.19.1 + FF 57.0 #1075
Comments
You cannot use |
findETCElement("name", webLocatorString).sendKeys(Keys.chord(Keys.CONTROL, "a"),Keys.DELETE, inputValueAndQuery); is not working with firefox 57, Version: 0.19.1. |
is not working with firefox 56\chrome 63\geckodriver 0.20 \chromedriver 2.36\selenium 3.8.1 |
Now I use execute_script("window.open();") in my tests and this works for me. |
So I had a script that I used cntl-'-' to zoom out of the window. Now after upgrading I find out it doesn't work anymore. I need it so so I can get my screen captures right size to fit the whole screen. How can I do this now if they don't allow control sequences? I am using geckodriver 0.21.0 and firefox 61.0.1 (64bit) |
Sending keys that affect chrome behaviour is explicitly intended not to work. WebDriver emulates user interactions with the web platform, not with the browser. |
OK I guess I don't understand what you mean to say here. I am looking for another way to zoom out of the current window if I can't use the control keys. |
Keys sent via WebDriver is intentionally not meant to have side-effects on the browser UI/chrome since that is outside the scope of the web platform. WebDriver automates and interacts with things that is inside the realm of the document. You can’t use WebDriver to change the zoom level of a document because that is not a web feature and not something which is implemented similarly across all UAs. |
So is there another method to do zooming out? or am I pretty much SOL? |
There wouldn't be any browser preferences for instance I could set when I initialize etc? |
The reason I really need this control is because I use the scripts to take snapshots of things on a web UI and I want them for logging purposes. However the screen shots get chopped off if I don't have the screen size right. |
In geckodriver you can enter chrome context through the Set Context command to gain access to changing the zoom level, but this won’t be cross-browser compatible. Zooming out to take a full-document screenshot seems very brittle due to the fact that many modern web apps loading more content as you scroll to edges (such as Twitter). Instead you can use the proprietary geckodriver API to take a full screenshot, or |
OK I missed that you replied here as well, but I still not sure how to use the geckodriver API to do it in python. Not sure if I follow what you mean on the firefox -headless option either an how I would put that into the python script or is that someplace else? |
Well I figured out what I was doing wrong to pass the headless option to firefox. However It looks like it still cuts off the bottom a bit. I like to figure out how to do it with the API command if possible because I sort of like to see what's happening while it is running. |
Ok, so here the example with the Python bindings of Selenium. Please note that other bindings might not have added support for from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox(...)
driver.get("https://mozilla.org")
driver.set_context("chrome")
win = driver.find_element_by_tag_name("window")
win.send_keys(Keys.META + "-") |
Oh Ok I didn't understand what andreastt was trying to tell me. Having code example makes it much clearer. I not sure if this means I don't have the support for set_context then? I thought I installed selenium onto python, but maybe its not the right version. driver.set_context("chrome") |
well I got it to work but somehow its hanging up when I do a find by css later on that I can't figure out. It seems like if i do the find_element by tag command its screwing things up later on. |
You will have to switch back to |
Cool thanks that fixed it!! EDIT: By the way I had to change from using the remote webdriver to the direct one as you had in your example. I presume that I can't use the set_context in the remote driver mode. |
System
Testcase
As a result, new tab is not opened.
The text was updated successfully, but these errors were encountered: