Issue with Jenkins running Cucumber causing timeout on JavaScript form

My current setup involves Cucumber 1.2.1 with Watir-webdriver 0.6.1 for webpage testing.

While the tests run smoothly on my local machine, I encounter a timeout issue on a CI machine (Jenkins) when trying to fill out a javascript form. Despite having email and password text fields, Cucumber struggles to populate them. In some instances, only the email field gets filled after a two-minute delay...

The javascript form opens as expected. Here's the link that triggers its launch:

`<a id="user_popup" class="textuser_popup" url="/en/bla/" href="javascript:void(0);" trackclick="click/unlogged/test/test/login" rel="nofollow"  gaclick="/en/bla/homepage/click:header-section>login">Sign in</a>`

Once the form loads, the code for the email and password fields looks like this:

<ul class="signin">
<li class="reg_form">
<label class="reg_form_label">Your email</label>
<input id="yourEmail" class="l_email" type="text" value="" name="email">
</li>
<li class="password_area">
<label class="reg_form_label">Your password</label>
<input id="yourPassword" class="l_password" type="password" name="password">
</li>
</ul>

Even utilizing PageObject and accessing the elements directly in the step has not proven effective. This is how I attempt to fill out the fields:

@browser.text_field(:id, "yourEmail").set("<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="adc8c0ccc4c1edc9c2c0ccc4c383cec2c0">[email protected]</a>")

@browser.text_field(:id, "yourPassword").set("thePass")

Ultimately, the encountered error reads:

execution expired (Timeout::Error)
/usr/lib/ruby/1.8/timeout.rb:64:in `rbuf_fill'
/usr/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
/usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
/usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
/usr/lib/ruby/1.8/net/http.rb:2028:in `read_status_line'
/usr/lib/ruby/1.8/net/http.rb:2017:in `read_new'
/usr/lib/ruby/1.8/net/http.rb:1051:in `request'
/usr/lib/ruby/1.8/net/http.rb:1037:in `request'
/usr/lib/ruby/1.8/net/http.rb:543:in `start'
/usr/lib/ruby/1.8/net/http.rb:1035:in `request'

Everything works fine when running the test locally. However, the failure occurs during remote execution. The remote browser (typically in headless mode, but I've initiated an X11 session for monitoring) is Firefox ESR 10.0.8, and the OS is CentOS.

If you have any insights or suggestions on what might be happening, please feel free to share. Additional information can be provided upon request.

Any guidance or recommendations are greatly appreciated :)

Answer №1

After encountering a similar issue, I successfully resolved it by including the subsequent code snippet within my env.rb script:

client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 300 # seconds – the default is 60
$browser = Watir::Browser.new :firefox, :http_client => client

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

Updating field based on dropdown value in CakePHP 3.6.11

I have the following tables: customers[id, name, surname, phone, text, balance, created] service_types[id, title, price, length, is_subscription, created] customer_service_types[id, customer_id, service_type_id, price, created] Within the add.ctp file o ...

JavaScript tutorial: Removing spaces in column names and creating case-insensitive queries

This morning, I encountered an issue while working on a web app that I am currently developing. The app is designed to read data from an excel file and import it into a SQL table. During the basic validation process, I noticed that the column headers in ...

Unable to execute internal functional tests due to this error: [POST http://localhost:4444/wd/hub/session] unable to connect - ECONNREFUSED

Currently working with node 0.12 and intern 3 in order to execute functional tests, but encountering the following error: SUITE ERROR Error: [POST http://localhost:4444/wd/hub/session] connect ECONNREFUSED at Server.createSession <node_m ...

The Angular material autocomplete feature fails to close automatically when the document loses focus

Normally, an input field will blur when you click on the 'body' of the document. But when using the autocomplete directive on desktop, the menu never closes on mobile unless you select an item or refresh the page. Initially, I thought this issue ...

How can I retrieve the value of a selected radio button within a fieldset using jQuery?

I have a fieldset with two radio buttons inside. When a radio button is clicked, I want to retrieve the value of the clicked button. However, my current jQuery code is not functioning correctly and I would appreciate any assistance. HTML: <fieldset id ...

Is it time for silverlight to take over for javascript once and for

It may seem like a far-fetched idea, but I can't help wondering if there is a way for Microsoft to come up with a new technology that allows C# code execution on both the server and browser side without relying on JavaScript. If all browsers were requ ...

The JavascriptExecutor in Selenium with Java is experiencing issues and is not functioning properly for Firefox version 24.0

In a few of my test cases, I've been using the following command because it's quite useful when trying to click on a hidden element that only appears when hovered over some context: ((JavascriptExecutor)driver).executeScript("$('selector_fo ...

The custom validation function in jQuery is not triggering

I am facing an issue with my HTML and JavaScript setup, which looks like this: <html> <head> <title>Validation Test</title> <script src="https://code.jquery.com/jquery-3.4.1.js"></script> <script src="htt ...

The global coordinate system is used to determine the direction of raycasting, not the local coordinate

Using the raycasting method to detect various colored strips on both sides of the track, I am able to keep my car object in position by calculating the distance. However, the issue lies in the fact that the ray always points in a constant direction in the ...

How do I retrieve the content within this HTML element using JavaScript based on its ID?

Is there a way to extract the string from this specific HTML element using JavaScript? The element has an id of recItemString_GPLA\|input, and within it, there is a string containing "qty" that I need to retrieve. Upon inspection of the element, the f ...

A guide to fetching a JSON Object from a URL using Node.js and Express

As a newcomer to Node.js and Express, I am venturing into my first real project with these technologies. In this simple Node.js/Express project, my goal is to retrieve a JSON object from a URL. Additionally, I plan to create another URL that shows HTML co ...

Filter products by price using Ajax in Shopify with Liquid code

I am looking to implement a custom product price filtering feature for my collection without relying on an app. Unlike the traditional price filter option, I want users to be able to input any combination of numbers, such as between $4 and $20 or $7 and $3 ...

ValueError: Unable to perform slicing operation on this data

When attempting a query in nodejs, I encounter this error: [2017-08-19 19:06:55.946] [ERROR] error - TypeError: val.slice is not a function at escapeString (/var/www/Bot/node_modules/sqlstring/lib/SqlString.js:183:23) at Object.escape (/var/www/Bo ...

Utilizing JQuery for real-time total updates

When a new div is created by clicking a button, I want to dynamically maintain an order system where the first div is labeled as 1 of 1, then as more divs are added it should change to 1 of 2, and so on. If a div is deleted, the numbering should reset back ...

Exploring the focus() method of refs in Vue 3

I'm struggling to comprehend why my straightforward test case keeps failing. As I delve into the world of testing in Vue, I've created a simple test where the element.focus() is triggered onMount(() => /* see implementation ...

Is there a way to automatically adjust the size of an input field after dynamic spans have been

I am looking to replicate the tagging functionality found on StackOverflow when posting a new question. In this case, spans are dynamically added using an input field located next to them. Here is an example: <div> <div id="multiple-span"&g ...

Prevent unauthorized AJAX requests from external sources within the Node application

I am looking for a way to prevent AJAX requests from being made outside of my application. I need to ensure that the response is not sent when the AJAX request is initiated from external sources, even if the URL is copied and pasted into a browser. My te ...

Is there a way to create an image gallery layout similar to Pinterest using CSS?

I am currently developing a dynamic PHP gallery that will feature thumbnails with the same width but varying heights. These thumbnails will be arranged from left to right, so I would prefer not to use a traditional five-column layout. I suspect that achiev ...

using regular expressions to find unclosed font tags that match on a single line

Even though regex is not typically recommended for parsing HTML, in this case we are dealing with a single line string input to a function. For example: <font color = "#ff0000"> hello </font>. I want the regex pattern to match only if the tag ...

Hovering over the top menu items in AngularJS will reveal dropdown submenus that will remain visible even when moving the cursor

I am facing an issue where my top menu has links that display a dropdown of additional menu items upon hovering. I have attempted to use onmouseover and onmouseleave events to control the visibility of the sub menu. However, I have encountered a problem ...