Giter Club home page Giter Club logo

headless-selenium-for-win's People

Contributors

kybu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

headless-selenium-for-win's Issues

headless IEs in one VM

hey, kybu,
First of all thank you for your code.
while I am struggling with multi-IEs in one windows VM problem and I found your code.
I googled a lot and found suggestion creating more VMs only.

I am using java8 and selenium3 with remote web driver located at windows7/8.1/10+IE11. I have put your headless selenium to the PATH, set up the selenium start args and its runs well.
using the util.exe to check the desktops and I can switch to it to see the IE too.
But I found one thing that if I DO NOT switch to the certain desktop, the selenium API (for example, CLICK or SENDKEYS etc) seems not work at all,although the selenium API such as navigate or findelement work well.

Am I missing something or can you give me some hint to let it work?
OR is it just like what the selenium group's IE wiki says, the windows IE need focus and IE sucks and can not be solved?

Selenium Python - headless hangs

Hey,

I am using Selenium and Python 3.5.2. When I use the visible IE Web Driver:

print("Loading IE...")
browser = webdriver.Ie()
print("IE Loaded")
browser.get("http://www.google.com")

The browser loads and runs fine.

As soon as I switch to:

browser = webdriver.Ie("C:\Program Files\Python\Scripts\headless_ie_selenium.exe")

this line of code runs, then hangs. The second print statement is never reached.
"C:\Program Files\Python\Scripts\headless_ie_selenium.exe" is in the PATH, along with IEDriverServer.exe - which is also in the same folder as the headless_ie_selenium.exe file.

desktop_utils.exe was also copied to the same location, does this need to be added to PATH as well? Why would it hang without error message?

Update:
It does seem to start the IEServerDriver as a process and when hitting ctrl+c to force close the scripts execution, it has errors with the request.py.

Does it work on windows 12 ?

Trying to use it on Windows 2012 but getting stuck. See that the HeadlessDesktop(verified with desktop_utils -l) starts up when I run my tests.

headless selenium not working with Jenkins/ windows slave

First off thanks for this great project, it's one of the only solutions i could find for headless IE.

Now for the issue, i have a windows slave that I want to run selenium tests on using the headless selenium driver.
When trying to run the tests manually from the windows slave using the headless selenium driver it runs without issues.
But when i try and run the tests from jenkins using the windows slave agent it cannot find any elements and screenshots return a blackscreen.
I'm really desperate to run my tests for IE on the windows slave, hopefully you can help me.
If you need any further information just let me know

System information:
Windows 10 windows slave
Jenkins version 2.73.1

Logs:

Started InternetExplorerDriver server (32-bit)
3.6.0.0
Listening on port 19936
Log level is set to WARN
Only local connections are allowed
okt 12, 2017 1:44:38 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
W 2017-10-12 13:44:40:554 CommandHandlers\SendKeysCommandHandler.cpp(238) Specified element is not the active element. Keystrokes may go to an unexpected DOM element.
W 2017-10-12 13:44:41:765 CommandHandlers\SendKeysCommandHandler.cpp(238) Specified element is not the active element. Keystrokes may go to an unexpected DOM element.
Started InternetExplorerDriver server (32-bit)
3.6.0.0
Listening on port 13178
Log level is set to WARN
Only local connections are allowed
okt 12, 2017 1:45:20 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C

  Scenario: Login with admin credentials                            # Login.feature:4
    Given Start application                                         # StartDefinition.startApplication()
    When login user "admin" with password "admin"                   # StartDefinition.loginUserAndPassword(String,String)
    Then find inputfield: "form-header-search:search-general_input" # ElementDefinition.findInputfield(String)
      org.openqa.selenium.TimeoutException: Expected condition failed: waiting for element to be clickable: By.id: form-header-search:search-general_input (tried for 15 second(s) with 500 MILLISECONDS interval)

Not working with Python 3.9

My IEDriverServer.exe is added to $PATH$, and headless_ie_selenium.exe is also in the same directory as the IEDriverServer.exe

I'm trying to use it like this:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

browser = webdriver.Ie('C:\IEDriverServer_Win32_3.150.1\headless_ie_selenium.exe')
# --------------- BEGIN: Login to PS/CAS -------------------#
browser.get('www.someurl.com')
assert 'American Express' in browser.title

I'm pasting the traceback below

Traceback (most recent call last):
  File "C:\Users\hjind\Desktop\pythonRCM\headless_ie.py", line 16, in <module>
    browser = webdriver.Ie('C:\IEDriverServer_Win32_3.150.1\headless_ie_selenium.exe')
  File "C:\Users\hjind\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium-3.141.0-py3.9.egg\selenium\webdriver\ie\webdriver.py", line 93, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\hjind\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium-3.141.0-py3.9.egg\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\hjind\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium-3.141.0-py3.9.egg\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\hjind\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium-3.141.0-py3.9.egg\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\hjind\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium-3.141.0-py3.9.egg\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070012 ('There are no more files.') for URL 'http://localhost:57762/'

Proper error handling

It is not like this app does not do any error handling but a few things can be improved.

Argument that avoids the explorer.exe

Hello!
Congratulations on developing desktop_utils. It really is a program that helps me a lot.
There is a small problem. Every time a program is run on a virtual desktop, a new process "explorer.exe" is started.
It would be interesting if we could pass a parameter to not start this process...
Thank you very much in advance.

Windows 2012 R2 and Scheduled Tasks

Hello!

I'm running into an issue when trying to run headless on Windows 2012 R2 with Scheduled Tasks.
Its not working. Stand alone, it works.

Logs:
2017-01-31 14:02:48,931 POST http://127.0.0.1:54423/session {"requiredCapabilities": {}, "desiredCapabilities": {"platform": "WINDOWS", "browserName": "internet explorer", "version": "", "javascriptEnabled": true}}
2017-01-31 14:02:48,963 Finished Request

nothing else after that.

Stand alone:
2017-01-31 14:08:30,842 POST http://127.0.0.1:54476/session {"requiredCapabilities": {}, "desiredCapabilities": {"platform": "WINDOWS", "browserName": "internet explorer", "version": "", "javascriptEnabled": true}}
2017-01-31 14:08:32,357 Finished Request
2017-01-31 14:08:32,357 <selenium.webdriver.ie.webdriver.WebDriver (session="21d32189-dd43-45b3-9e7f-33414a9a1011")>
2017-01-31 14:08:32,357 Starting Selenium
2017-01-31 14:08:32,357 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/url {"url": "URL", "sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011"}
2017-01-31 14:08:32,592 Finished Request
2017-01-31 14:08:32,592 Got site
2017-01-31 14:08:32,592 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element {"using": "id", "sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "value": "userName"}
2017-01-31 14:08:32,654 Finished Request
2017-01-31 14:08:32,654 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element/d0742ab7-ac34-4aca-8e1c-c294b8d3844e/clear {"sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "id": "d0742ab7-ac34-4aca-8e1c-c294b8d3844e"}
2017-01-31 14:08:32,842 Finished Request
2017-01-31 14:08:32,842 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element {"using": "id", "sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "value": "userName"}
2017-01-31 14:08:32,888 Finished Request
2017-01-31 14:08:32,888 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element/d0742ab7-ac34-4aca-8e1c-c294b8d3844e/value {"sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "id": "d0742ab7-ac34-4aca-8e1c-c294b8d3844e", "value": username}
2017-01-31 14:08:33,342 Finished Request
2017-01-31 14:08:33,342 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element {"using": "id", "sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "value": "password"}
2017-01-31 14:08:33,388 Finished Request
2017-01-31 14:08:33,388 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element/787443f7-234c-4e75-8664-d701a7a7c275/value {"sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "id": "787443f7-234c-4e75-8664-d701a7a7c275", "value": password}
2017-01-31 14:08:33,670 Finished Request
2017-01-31 14:08:33,670 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element {"using": "name", "sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "value": "okBT"}
2017-01-31 14:08:33,732 Finished Request
2017-01-31 14:08:33,732 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element/848c8b01-bf95-4df0-beb3-42e6afb9e942/click {"sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "id": "848c8b01-bf95-4df0-beb3-42e6afb9e942"}
2017-01-31 14:08:34,450 Finished Request
2017-01-31 14:08:34,450 made clicks
2017-01-31 14:08:34,450 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/url {"url": "URL", "sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011"}
2017-01-31 14:08:34,686 Finished Request
2017-01-31 14:08:34,686 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element {"using": "name", "sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "value": "attachment"}
2017-01-31 14:08:34,732 Finished Request
2017-01-31 14:08:34,732 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element/4aeab561-0c3d-4995-9092-1302dee5154b/value {"sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "id": "4aeab561-0c3d-4995-9092-1302dee5154b", "value": [inputting data]}
2017-01-31 14:08:37,357 Finished Request
2017-01-31 14:08:37,357 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element {"using": "name", "sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "value": "loadBT"}
2017-01-31 14:08:37,404 Finished Request
2017-01-31 14:08:37,404 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/element/d99b4902-0acf-41e3-92de-ece7261412c6/click {"sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "id": "d99b4902-0acf-41e3-92de-ece7261412c6"}
2017-01-31 14:08:37,592 Finished Request
2017-01-31 14:08:37,592 POST http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011/timeouts/implicit_wait {"sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011", "ms": 60000.0}
2017-01-31 14:08:37,607 Finished Request
2017-01-31 14:08:37,607 quiting
2017-01-31 14:08:37,607 DELETE http://127.0.0.1:54476/session/21d32189-dd43-45b3-9e7f-33414a9a1011 {"sessionId": "21d32189-dd43-45b3-9e7f-33414a9a1011"}
2017-01-31 14:08:37,638 Finished Request

Is it that selenium doesnt support running through task scheduler?

Issues on 64 bit windows geckodriver

Chromedriver works fine. I am using Anaconda Python 3, but when I use geckodriver it doesn't recognise the path. A workaround was..

import os
os.environ["HEADLESS_DRIVER"] = "geckodriver.exe"
from selenium import webdriver
driver = webdriver.Firefox(executable_path=r'C:\Users\Dan\Anaconda3\headless_ie_selenium.exe')
driver.close()

However, it doesn't act as it should. My only assumption is that as I am using 64 bit windows it is not working correctly. As you can see https://ibb.co/iy44Rv it is not closing. It seems to launch and then that's it. It also uses about 20% of cpu and i have an i7 4790k and default firefox uses less. Thanks.

Add support for other web-drivers

E.g. other browsers on Windows like Chrome or Firefox can be launched like IE using driver binary. It would be great to have just an ability to specify driver binary and after starting its process simply proxy all requests to the port.

How to pass command line arguments to running application?

I was unable to find out proper way to pass command line arguments to application that I want to run within virtual desktop with the help of desktop_utils. For example, I want to open some URL in Firefox instance. Following command is not working:

C:\Program Files (x86)\Mozilla Firefox>desktop_utils --desktop D1 --run "firefox.exe http://masterhost.ru/"
Could not create the 'firefox.exe http://masterhost.ru/' process in the 'D1' desktop!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.