I am trying to lauch a Selenium scrit from a Python script and it gets stuck at "11:16:32.144 INFO - Launching Firefox..."
The Selenium server is running well, I also tried the Selenium IDE and it works. I am using Ubuntu lynx, Firefox 3.6.23, Selenium server 2.11.0
What do you think it could be ?
Thank you very much.
Regards.
It could be that Selenium can't find firefox somehow?
Is the process ending? or just hanging?
Try starting selenium runner manually, say from ipython, something like:
from selenium import selenium
sr = selenium(host, port, "*firefox*", url)
sr.start()
and see if you get an exception?
Related
I want to use the selenium webdriver on a linux server running Ubuntu. How can I use selenium on said server without opening a browser, as it doesn't have one? I'm using Selenium with Python and Gecko(Firefox), but I'll be willing to switch to JavaScript or Chrome if I have to.
I am trying to run selenium by running the below two lines of code after giving the path to chromedriver..
from selenium import webdriver
driver=webdriver.Chrome("C:/Users/Admin/Desktop/chromedriver")
But its not working and displaying the below error.
selenium.common.exceptions.WebDriverException: Message: Service C:/Users/Admin/Desktop/chromedriver unexpectedly exited. Status code was: 1
Can you please tell how to fix it ?
Check your chrome brower version and download chromedriver accordingly from below url https://sites.google.com/a/chromium.org/chromedriver/downloads
from selenium import webdriver
browser = webdriver.Chrome(executable_path=r" path of chromedriver.exe")
browser.get('your url')
i think you are missing some libraries, i had a similar problem when i was trying stuff with selenium. try installing the chromium driver as well cause it might have the libraries you need, even if you don't want to use chromium
I'm following this online resource, for building an Instagram bot. In it, the instructor uses selenium, which I installed by running: pip3 install selenium
Then he mentioned using ChromeDriver. I downloaded it and installed it following this resource. I tested it and seemingly it worked, however when I tried to use it in my script it crashed, an error message occured: Error sending sync broker message: the pipe is being closed (0xE8)
The script which I ran when the error occurred is:
from selenium import webdriver
class InstaBot:
def __init__(self):
self.driver = webdriver.Chrome()
self.driver.get('https://instagram.com')
InstaBot()
How my I resolve this error? I read through dozens of articles, but still not found what causes. Help is appreciated.
I have checked your code and it works fine for me.
Try to update your chrome browser to the latest version (79.0.3945.130) and download its match ChromeDriver version (79.0.3945.36).
Note that the ChromeDriver should be on the same folder with your code.
For a project, I need to use Selenium Webdriver for running my test case on a server. I have seen the documentation, but I do not know how to implement it in my code and how to use it.
I have already test with:
driver = webdriver.Remote(command_executor='http://ip_address:4444/wd/hub/static/resource/hub.html',desired_capabilities=DesiredCapabilities.FIREFOX)
But it doesn't work.
PS: I use Python for my test and Linux is the os of my server.
Try
driver = webdriver.Remote(command_executor='http://ip_address:4444/wd/hub/',desired_capabilities=DesiredCapabilities.FIREFOX)`
the URL you are using in your code there looks quite broken to me :-/
I'm trying to use selenium from python but I'm having a problem running it on a RHEL5.5 server. I don't seem to be able to really start firefox.
from selenium import webdriver
b = webdriver.Firefox()
On my laptop with ubuntu this works fine and it starts a brings up a firefox window. When I log in to the server with ssh I can run firefox from the command line and get it displayed on my laptop. It is clearly firefox from the server since it has the RHEL5.5 home page.
When I run the python script above on the server it (or run it in ipython) the script hangs at webdriver.Firefox()
I have also tried
from selenium import webdriver
fb = webdriver.FirefoxProfile()
fb.native_events_enabled=True
b=webdriver.Firefox(fb)
Which also hangs on the final line there.
I'm using python2.7 installed in /opt/python2.7. In installed selenium with /opt/python2.7/pip-2.7.
I can see the firefox process on the server with top and it is using a lot of CPU. I can also see from /proc/#/environ that the DISPLAY is set to localhost:10.0 which seems right.
How can I get a browser started with selenium on RHEL5.5? How can I figure out why Firefox is not starting?
It looks like the problem I'm encountering is this selenium bug:
http://code.google.com/p/selenium/issues/detail?id=2852
I used the fix described in comment #9 http://code.google.com/p/selenium/issues/detail?id=2852#c9
That worked for me.