Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8357381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:27:29+00:00 2026-06-09T10:27:29+00:00

An instance of Unicorn HTTP server runs on my server. It loads some files

  • 0

An instance of Unicorn HTTP server runs on my server.
It loads some files in this directory :

~/apps/myapp/current/

This path is a symbolic link to the last release in this path :

~/apps/myapp/releases/234234532/

This is configured by Capistrano at deployment time.
In order to make sure that Unicorn well restarts, I do it also manually even if my deploy.rb contains a deploy:restart task called at the end since I read that there would be some issues with Capistrano against Unicorn.

My app is about to launch a Selenium instance by means of Selenium WebDriver.
However, and that’s my problem, Selenium seems to points to an old release.

To be certain, I chose to remove critical files of my process, in order to see if my app still launches well and that was the really good release I expected.
Hopefully, my apps didn’t launch and some logical errors appeared.

So now I’m certain that I point to the good release, I don’t understand the Selenium’s behaviour. I’m explaining:

The error appearing within log is :

invalid page structure: Unable to locate element: {"method":"id","selector":"sectionSearch"}
Command duration or timeout: 1.02 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:08:38'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.13-grsec-xxxx-grs-ipv6-64', java.version: '1.7.0_147-icedtea'
Driver info: driver.version: EventFiringWebDriver (org.openqa.selenium.NoSuchElementException)

To sum up, Selenium complains with the id element: sectionSearch as being missing in the concerned HTML page.

So, as suggests this article: http://seleniumhq.org/docs/04_webdriver_advanced.html, I increased timeout before informing that a particular html element doesn’t exist:

wait {driver.find_element(:id, 'sectionSearch')}  

For information, wait is a custom method:

def wait(timeout = 50, &block)
    Selenium::WebDriver::Wait.new(timeout: timeout).until(&block)
end

In a local computer (development environment), that works maybe because I use another SeleniumDriver: FirefoxDriver

def driver
    @driver ||= begin
      if Rails.env.production?
        driver = Selenium::WebDriver.for :remote, url: 'http://localhost:4444/wd/hub'
      else
        driver = Selenium::WebDriver.for :firefox
      end
      driver.manage.timeouts.implicit_wait = 20
      driver
    end
  end

But still the same issue with my server after even killing and restarting unicorn:

invalid page structure: Unable to locate element: {"method":"id","selector":"sectionSearch"}
    Command duration or timeout: 1.02 seconds

So, my last action was to manually change inside the server’s application current folder the line:

wait {driver.find_element(:id, 'sectionSearch')} 

by

wait {driver.find_element(:id, 'sectionSearchhhhhhhh')}

Now my expectation is to see Selenium complains with this missing element and so the error would be logical. Why doing this? Because I want to be sure that Selenium takes UPDTATED source files.

And it seems that it wasn’t the case since…same error like the preceding one appears.

Anyone having an idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:27:31+00:00Added an answer on June 9, 2026 at 10:27 am

    This is a selenium error and you are getting it whether because your webdriver times out before reaching the element or because you have denoted the wrong selector (i.e –> you are getting error element not found). If I was you I will use xpath as the selector as it seems to be the most reliable locator out there. Let’s take for example Google’s search box as an element. You have the following html code for the box:

    <input type="text" name="q" value="" id="searchText" maxlength="256"/>

    The way you will form your selenium element locator using the html code above will be like this..:

    driver.find_element(:xpath, "//input[@name='q']")

    However this is not enough as I’ve noticed in your description above; you’ve tried setting the implicit wait. A better way of achieving the effect you want is this..

    !30.times { if (driver.find_element(:xpath, "//input[@name='q']") rescue false) then break else sleep 1; end }

    The code above will try 30 times, waiting 1 sec before each attempt to reach the desired element (if it fails you can capture the error by using begin/rescue clause as such:

    begin
       .    
       .
     [your code]
       .
       .
    !30.times { if (driver.find_element(:xpath, "//input[@name='q']") rescue false) then break else sleep 1; end }    
       .
       .
    driver.find_element(:xpath, "//input[@name='q']") #so you cause an error that u can capture
       .
       .
    rescue    
    puts "A time-out error occurred or you have used an invalid element locator"
       .
       .
    end
    

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried this tutorial http://adrian.org.ar/python/django-nginx-green-unicorn-in-an-ubuntu-11-10-ec2-instance to setup django with ngnix and gunicorn.I have
server declaration in my nginx.conf: listen 1.2.3.4:443 ssl; root /var/www/myapp/current/public; ssl on; ssl_certificate /etc/nginx-cert/server.crt;
For instance, this takes 4 lines which is too much space for such a
For instance: I have a swf, lets say A, that loads another swf, B.
I'm having some difficulty with this, but basically load a page into a QWebView
For instance, I've tried things like this, which doesn't work: mydict = { 'funcList1':
For instance what should I add to this expression: xyplot(a~b, groups=abc, data=super, scales=list(x=list(log=TRUE),y=list(log=TRUE)), panel
for instance this code: struct test{ int ID; bool start; }; struct test *
For instance, in VB.NET: Dim strArray(5) As String As I understand it, because this
Using instance methods as callbacks for event handlers changes the scope of this from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.