Support switching windows and getting some window information on browsers without javascript#788
Conversation
| "return [ window.id, window.name, document.title, document.URL ];") | ||
| try: | ||
| id_, name = browser.execute_script("return [ window.id, window.name ];") | ||
| except WebDriverException: |
There was a problem hiding this comment.
Unfortunately this is the exception type raised, it would be nice if it was something more specific.
There was a problem hiding this comment.
It's alright. At least it indicates that some sort of selenium error did happen and it is, in this case, OK to suppress the error.
|
It doesn't look like those failing tests have anything to do with my changes. |
|
Write an issue where you explain the problem you are having, It also helps maintainers to keep track of the changes. By a quick look from a mobile screen, PR looks OK. But I have to give it a closer look from the mobile screen. The test did stuck for some unknown reason and it happens sometimes in the Travis. I did rerun test and let's see the results. |
|
Hi, I created an issue for it. It looks like the remaining test failure is a false positive (all the recent builds seem to have the same failure for the same reason). |
|
Thank you. Yes the Python 3 support is not ready and therefore one of the CI jobs fail. |
| "return [ window.id, window.name, document.title, document.URL ];") | ||
| try: | ||
| id_, name = browser.execute_script("return [ window.id, window.name ];") | ||
| except WebDriverException: |
There was a problem hiding this comment.
It's alright. At least it indicates that some sort of selenium error did happen and it is, in this case, OK to suppress the error.
I'm using this library with QtWebDriver to test Qt applications. Some of the windows in my application are not actually web-based, so they don't support the
execute_scriptcommand. Currently this makes it impossible to switch between windows because a script is used to get the window title and url.By using the web driver API instead of a custom
execute_scriptwe can implement the same functionality without javascript.