I'm trying to run my selenium scripts via Jenkins on Ubunt server 16.04 without GUI.
And before to open a web page it requires make an windows authentication. I created for Windows with AutoIT and it works good but now I have to execute via Jenkins on Ubunt server, and got the following error:
Using deprecated data structure for setting timeouts
java.io.IOException: Cannot run program "/usr/share/GlobalStagingERP/global.staging.erp/authentification/WindowsAuthenticationFireFoxCodeExample.exe": error=13, Permission denied
And I decided to do it with python and SciTE.
Also I tried 'https://username:password#my_url/' but it didn't work and got a fatal error.
This is an example how I'm using AutoIT script to handle authentication in window:
WinWaitActive("Authentication Required","")
MouseClick("left",331, 288,1)
Send("username")
Send("{TAB}")
Send("password")
Send("{ENTER}")
But how can I do it the same action in SciTE using python?
Related
let me explain the problem in detail:
I have a Windows 10 desktop, from which i connect via RDP (same LAN) to a laptop running Kali Linux 2022.3.
On this laptop, i have Conda and Spyder for developing some webscraping Python scripts.
I developed a web scraping script that simulate a user navigate to a site, logging in, upload a document and log out (this is to iterate some real-work stuff).
In my script i use selenium and pyautogui.
In my testing process:
from desktop i RDP to laptop
from laptop (i login with root) i open spyder
i run the script (chromedriver in headless mode, altough i tested it also in viewable mode).
everythings run just fine. it open the browser, login, upload the file and logout. (also in headless mode the test succeed, i see no browser BUT i have a mail confirmation that the script ran successfuly).
The problem comes when i try to schedule the script via crontab.
I made a scraper.sh with:
/path_to_python/ /root/path_to_script.py >> /root/out_err.txt 2>&1
And then, in crontab i put the line (i want the script to run at 15 every 2 day):
00 15 */2 * * /root/scraper.sh
I wait connected to the laptop until the script fires, and of course the script RUN, but does nothing. So i go to the the out_err file, and i find:
File "/root/anaconda3/lib/python3.9/site-packages/Xlib/protocol/display.py", line 129, in __init__
raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'Authorization required, but no authorization protocol specified\n'
I am stuck at this point, where my knowledge fail me ;-)
Can anyone help? Thank You very much.
David
I have followed around 5 tutorials on using NSSM to run a python script residing on a network drive. It creates the service, I can edit the service but when I start the service I get the following error:
Unexpected status SERVICE_STOPPED in response to START control
When I try starting the Windows-10 service from Services I get the following error:
Services error during start
I have changed the path to the python script from the full network path to a mapped network path and that did not change anything.
I have also tried using Task Scheduler which worked once in a while and was intermittent and I also tried the pywin32 method as posted here but it fails to start the service as well.
I figured it out. On my remote VM it does not allow Local System Account to be set as the Log on. It required me to add an admin user name and password. It's running now.
I'm trying to run a Selenium Script (Using PHP) using a Webserver.
I'm working on Kali and to simulate the Webserver I use Xampp.
I tried to run the selenium script on Xampp by the following steps:
-Download the Php Webdriver Bindings, put them in the folder 'htdpcs' of xampp and edit the 'example.php' file following the settings of my own device.
-Download and execute the Selenium Server Standalone, on port :4444.
In the end, I download the geckodriver and I execute the file, but I got the this error:
OSError: [Errno 98] Address already in use
How to fix it in order to run the php-selenium script?
The Selenium Server will fork a geckodriver as soon as it needs one to start a new browser session. You should not start a geckodriver yourself. If you want to use its Webdriver API yourself you can start it with the --webdriver-port argument.
I have a Djnago web application on IIS 6 on one server. Is there a way that from this website I call another python script that is on another server in such a way that that script just run itself there?
Calling or Runnig that script in the usual way as internet says, is not working.
I always get the error of os.getcwd() and it also doesn't allow to change that directory.
I just want to run that python script there on that server from this server.
Can anyone help?
Normally, I would recommend using a framework like fabric or winrm if you want to run a python script on another server. Those frameworks use ssh or windows remoting functionality, respectively, to allow a python program to execute other commands (including python scripts) on other systems. If the target machine is a windows machine, be forewarned that you can run into all sorts of UAC issues doing normal operations.
I'm trying to build a python script and freeze it with cx-freeze but with Vista User Access Control support.
As it stands my script runs fine under Server 2003/Win XP, however I need to be able to write files into the root of a drive which requires elevated privileges under UAC.
My compiled script is then executed by another process (scheduling engine) which runs my script under a service account (with local Admin + domain admin rights) however because I don't have a manifest(?) and UAC is enabled, my script will always return permission denied errors.
Py2exe seems to have a solution for Vista UAC, however I am using cx-freeze with Python 3.1 because of requirements on new code in python 3.1 that I call.
Is there a solution to this (apart from disabling UAC which I can't get approved) for cx-freeze?
According to Python documentation UAC is automatically supported from version 2.6.
See http://docs.python.org/distutils/builtdist.html.