Connection to Firefox at 127.0.0.1:7055 on CentOS could not be established within the 60-second time frame

Encountering the following error message:

unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
when executing this code:

require 'watir-webdriver'
require 'headless'

headless = Headless.new
headless.start

begin
    browser = Watir::Browser.start "https://google.com"
rescue Exception => e
    puts e
    puts "Exiting..."
    exit
end

browser.goto "http://google.com"
puts browser.url
browser.close

Using Firefox version 38.7.0, Headless gem version 2.2.3, and Selenium-Webdriver gem version 2.53.0.

Attempted solutions include:

  • Updating selenium-webdriver
  • Uninstalling/reinstalling headless, selenium, and Firefox
  • Restarting the server
  • Upgrading Firefox to version 45.0

The code works without issue in other test environments.

Additional Updates:

Trying to run the same code with Chrome resulted in a new error message:

unable to connect to chromedriver 127.0.0.1:9515

To ensure correct installation, ran the command:

yum install xorg-x11-server-Xvfb

Response:

Package xorg-x11-server-Xvfb-1.15.0-36.el6.centos.x86_64 already installed and latest version
Nothing to do

Also executed:

yum install firefox

Response:

Package firefox-38.7.0-1.el6.centos.x86_64 already installed and latest version
Nothing to do

Answer №1

After some investigation, it became clear that the issue stemmed from user rights. When I switched to the root user, I was delighted to find that the code executed flawlessly without encountering any errors.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is preventing selenium from locating the chrome driver?

As I was following a tutorial on creating a web scraper for Twitter using Selenium and Python, I encountered an issue. File "C:\Python34\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __i ...

Retrieve the outer-HTML of an element when it is clicked

I am working on a project to develop a tool for locating xpath, and I am seeking the most efficient and user-friendly method for allowing the user to select the desired element on a webpage. Ideally, this selection should be made with just a single click, ...

selenium.common.exceptions.InvalidArgumentException: Error: the specified argument is not valid - incorrect locator provided

Hey there, I've been working on creating a bot using selenium and encountered an issue with the send keys function. Despite trying for hours, I can't seem to figure out how to make it work. If anyone has any insights or solutions, I would greatly ...

Launching a hyperlink in a fresh tab

When using Selenium, I encountered an issue with opening a link in a new window. After some research, I came across the following two methods: 1) Actions act = new Actions(driver); act.contextClick(we).perform(); myWait(1000); // allow the menu to come u ...

Struggling to input data into Excel using Selenium WebDriver

I encountered an issue while attempting to write two strings to an Excel sheet using the following code. The error message I received was: java.lang.IllegalArgumentException: Sheet index (0) is out of range (no sheets) FileOutputStream fout=new FileOutput ...

Transitioning from using Firefox WebDriver to Marionette

Looking to make the switch from FireFoxDriver to MarionetteDriver has been a bit of a challenge for me. I've successfully run Firefox with MarionetteDriver using the following code: public void runMarionnete(){ DesiredCapabilities dc = DesiredCap ...

How can we redirect to another page after checking a box?

In the scenario where a checkbox is checked, how can the page be automatically redirected to @habit, simulating the behavior of clicking a submit button? habits/show <% if @habit.current_level_strike %> <div class="btn" id="red"> <l ...

PageFactory error: incorrect amount of parameters provided (2 instead of 1)

Currently implementing the page factory pattern and encountering Argument errors in multiple locations. This is the code for my Homepage class: require 'page-object/page_factory' class Homepage include PageObject include Configuration ...

Utilize protractor to access the window object or browser scope in your test scripts

While conducting tests with protractor, I have encountered difficulty in accessing the JS 'window' object. I attempted to add a script tag in my HTML file containing something like var a = window.location; However, when I tried using expect(a) ...

Tips for arranging a draggable list in Selenium

Here is a link for practicing sorting: I attempted the sorting with the following code: Actions action = new Actions(driver); List<WebElement> elements = driver.findElements(By.xpath("//*[@id=\"demo-tabpane-list\"]/div/div&q ...

Automate Data Extraction from Tables Using Python Selenium and Convert them into a DataFrame

I am just starting to learn Python and selenium, and I'm facing a challenge that I need help with. Currently, I am attempting to extract data from a particular website: "" The goal is to convert the table on this website into a dataframe similar to ...

Encountering difficulties with submitting a drupal menu add form through Selenium

My quest to create a new menu in Drupal (8 URL: <site url>/admin/structure/menu/add) using the Python Selenium Chrome Webdriver has hit a roadblock - every time I attempt to submit the form, nothing seems to happen. I've explored various method ...

Selenium in Python encounters difficulty locating web element

I've been attempting to extract posts from a forum I found at this specific URL: The main content I'm trying to pull is located within: <div class="post-content"> However, no matter if I use get element to search by XPATH or CLA ...

Generating links within a popover using an array in Rails 4

Within my application, Users have the ability to recommend other Users' profiles seamlessly. The functionality related to models and associations is working perfectly, as I am able to identify which users have recommended the current_user's profi ...

Strategy to implement when a web element is appearing and disappearing twice

I am currently facing a challenge and I need help resolving it. Using Selenium and Helium, I am conducting tests on a web application. During the testing process, the web app displays a screen blocker that appears and disappears twice. I need to wait fo ...

Scraping social media followers using web scraping, however, the list is massive with hundreds of thousands. Selenium crashes due to memory overload

After using Selenium in Chrome to gather usernames from a social media profile, I encountered an issue with the limited loading of the page and Chrome crashing due to running out of memory. The list of followers is extensive, reaching hundreds of thousands ...

How to make Firefox create a new line in a contenteditable field

I am working with a contenteditable div that is within a parent div with a floating width of 50%. My goal is to set the max width of the content editable to match the container, even if the text spans multiple lines. Here is the CSS I tried: .editable-con ...

Having trouble creating the right XPath for the top movies on IMDB using Selenium

I'm having trouble clicking on the Top Rated Movies section within "Movies, TV & Showtimes" on IMDB. I'm unsure of how to write the correct xpath for it and can't seem to figure out how to click on it. Below is the snippet of code I am usin ...

Using Selenium to handle asynchronous JavaScript requests

Having recently started working with Selenium and JavaScript callback functions, I've encountered a problem that I can't seem to solve on my own. My issue revolves around needing to retrieve a specific variable using JavaScript. When I manually i ...

Access Chrome's console log using Ruby WebDriver

I came across a question that was previously answered for Java (Get chrome's console log) However, I am currently working with Ruby bindings and I'm curious if it offers similar functionality? I have checked the Ruby source code but couldn' ...