I am trying to run a Selenium script that I created using Python bindings as an executable on a remote headless machine. The problem is that the scripts behaves differently when executed remotely.
I have done the following steps:
- Created a Selenium script (with Python bindings) that works perfectly on my local virtual machine.
- Transformed the above mentioned script into an standalone executable using py2exe. This one works on my local machine as expected as well.
Run the created standalone executable on a remote VM that is absolutely similar to the one I was developing and testing the initial script on (in step 1). The only difference is that it's headless. For remote run I am using PsExec from PSTools utilities set. I run it in the following way:
PsExec.exe \vmcle001iso -u rhdwa\he119712a -p Password123 -h c:\dist\test.exe
This is when my problems start. The first thing I've mention that some of Python commands stopped working. For example, usual Pythin exit(0)
return with error:
Traceback (most recent call last):
File "nacs.py", line 103, in <module>
NameError: name 'exit' is not defined
But my main problem that some of the elements become unable to find or interact with. Thus, certain buttons that worked perfectly before, return with Selenium exceptions like:
WebDriverException: Message: u'unknown error: Element is not clickable at point (960, 23). Other element would receive the click:
So just to emphasize that again, it all happens just when I run the executable remotely. Most of the code works as expected though.
Any hints to what might cause such behavior are very welcome.