Questions tagged [capybara]

Capybara is a web application testing framework for Rack applications, such as Rails, Sinatra and Merb.

0
votes
1answer
27 views

Capybara attach_file not triggering React onChange handler in Firefox

I'm testing file upload functionality on a page built with React. The React page has a hidden file input field with an onChange event listener wired up to it. When a file is selected it triggers the ...
0
votes
1answer
23 views

Why find(element).click uses max_wait_time instead of the specified wait:0 if the element is not clickable?

Background: checking if element is clickable (I expect it to be not clickable, I want to assert this) without waiting. find().click uses Capybara.max_wait_time and then returns exception: Selenium::...
0
votes
0answers
19 views

Why is chromedriver failing with ruby 2.4.0 and bundler 2.0.1 with undefined method `[]' for nil:NilClass (NoMethodError)

i am trying to run my ruby app which uses capybara. It worked on another machine but when I switched machine and installed ruby and bundled and ran it on the new machine I got: me/service.rb:115:in `...
1
vote
0answers
31 views

How to fix 'unable to connect to chromedriver'

I create one capybara test. It works on local machine but at bitbucket pipeline not. I set port Capybara.server_port = 9516 but then the capybara test tries to connect to 9516.  1) Visit back ...
0
votes
1answer
34 views

Capybara can't find element if JS is present

I want to test that a user can skip the shipping_address form after his registration. So I have this button in the form, with some Javasrcipt that redirect to the page the user was before. If I ...
0
votes
1answer
17 views

Filling in a search box and then clicking on the autocomplete

I am having trouble filling in and clicking this search box <input type="text" name="js-emu-operation-search" id="js-emu-operation-search" placeholder="Enter service name" autocomplete="off"> ...
0
votes
0answers
27 views

How can I switch to a different browser during a Cucumber Capybara test?

I am currently using Thor to set an environment before running tests, this will lock me into firefox or chrome. My objective is to switch to a different browser during the test and continue there. ...
9
votes
2answers
178 views

Selenium WebDriver Error: invalid session id

I use Selenium WebDriver and Chrome to do feature testing in my app. I have already successfully setup multiple rails app with rspec, capybara and selenium, but I can't get why this one does not work. ...
0
votes
1answer
51 views

Capybara Selenium reuse existing browser session, instead of opening new windows?

In Capybara, How can I resue existing browser to continue run step next. Instead of star a new session and open a new windown and next run a ton of step before. For example : First: session = ...
0
votes
1answer
18 views

How to find text using capybara when the text is hidden?

I'm just getting into automated testing, and I've been experimenting with different tests for different browsers. I'm trying to find a specific text on a page (postcode, which has been previously read ...
0
votes
1answer
19 views

how to write remember me feature in Rspec-rails?

I use the sorcery gem to complete the login feature,and I have used the "remember me" feature.But I don't know how to write the test code with Rspec.I found the Capybara gem but don't know how to use ...
0
votes
1answer
35 views

Selenium Webdriver connection timing out while running automation tests

While running automation tests I sometimes get a timeout error for Selenium Webdriver (I think this is where the issue is at least). Me and my team have all recently migrated to Macbooks (from a ...
0
votes
1answer
30 views

Difficulty debugging RSepec

I'm trying to debug my feature spec in RSpec. But I'm unable to get an exception. If I put a binding.pry before auth.save!, I'm able to break in. I then check if auth.valid? and it returns true. I ...
-1
votes
1answer
38 views

How to get the user agent for a headless browser

I am running my tests on headless chrome browser and need to get the user agent of the headless browser. For a Chrome browser, that is not headless I use this code to get the user agent: page....
0
votes
0answers
36 views

Got ambiguous match error while trying to count number of element that exist on the page

I'm trying to count how many the star is selected based on this HTML <div class="c-fld"> <ul class="js-review-star c-rating"> <li data-value="1" title="Very Bad product" class="c-...
0
votes
2answers
29 views

How do I have a create a signed in user before running an Rspec feature test?

I'm trying to write a feature test (using Rspec 3 and Capybara) that tests a user adding an address (string) and getting the coordinates in response. Users need to be signed in before they can do this,...
0
votes
2answers
40 views

EOFError with Capybara, Puma, Rails System Tests under SSL

Running Rails system tests under SSL exhibits strange behavior and I'm not sure if it's a bug or by design. This very basic Example Application has one system test that looks for an element on the ...
0
votes
1answer
35 views

My .click method only works sometimes then gives an error other times

I am using Capybara to scrape a site and one of the actions is clicking a button. Sometimes Capybara clicks it and other times is gives this error /Users/maximushan/.rvm/gems/ruby-2.4.2/gems/...
0
votes
1answer
21 views

accessing session after login and logout in feature spec

I want to be able test that after logout the session is invalid. For this I want to check that after login, session exists and i want to get the session details. After logout the session no longer ...
0
votes
2answers
38 views

How to avoid pending requests to fail after database rollback in integration tests?

We have been experiencing an intermittent issue and I would like to see if someone in here has insight to how we can tackle it. We are doing our integration tests with Minitest + Capybara and Chrome ...
1
vote
1answer
120 views

Suppress Selenium Warnings when running Cucumber Test on Local Machine

I am trying to suppress selenium warning whenever I run a cucumber test on my local machine. I tried the following: options.add_argument("--disable-logging") options.add_argument('log-level=3') ...
1
vote
1answer
32 views

Capybara / Ruby - Trying to get only the Text from all ambiguous css selector and convert it to string

I'm trying to get all Texts from a specific CSS Selector that are ambiguous in the HTML. I would like to access these ambiguous css and get the Text and then return all that info. I've figured out ...
0
votes
1answer
25 views

Capybara / Ruby - Trying to get a text from an invisible element and then convert it to string

I'm trying to get a specific text value from a CSS Selector that belongs an invisible element. After that I would like to convert the text (from the element) into a String to use the slice method ...
0
votes
0answers
20 views

Capybara/Rspec test resulting in post to route that does not exist

My tests with rspec/capybara/phantomJS have been very inconsistent and result in tests that sometimes pass/fail (for stripe in particular) because it will sometimes not enter all the keys that are ...
0
votes
1answer
47 views

Feature spec pass locally but fail on Circle CI

I have feature specs for my ActiveAdmin view. It works on my local machine. But when ran in CircleCi it fails with undefined method `text' for nil:NilClass spec it 'uses the update_at date when ...
0
votes
4answers
53 views

Capybara should have_content is not waiting long enough

So I am writing an acceptance test using capybara. The scenario was to connect our newsletter system to external mail service. We will get redirected to our external service page to request access to ...
0
votes
2answers
42 views

How to select from a selection box with a variable in the name?

I am having trouble using selecting from this select element. <select name="vehicle_attrs[position_count]" class="mb1"><option>Position / Quantity</option><option>Front</...
0
votes
0answers
47 views

Automated test works locally but fails on browser stack due to not clicking

Created a test case that passes locally then fails when running in browser stack. The root cause is that an element is not being clicked. When I run this locally the element is always clicked. Using ...
0
votes
0answers
25 views

Cucumber, poltergeist strange error, while running code

I am getting below error while executing Cucumber test cases, Below mentioned error details, when I execute command cucumber ➜ cart git:(master) ✗ cucumber Feature: To see cart options ...
-2
votes
2answers
32 views

What is a good schema for naming screenshots in selenium webdriver + capyabara

First pass: I name my screenshot "x". Obviously that minimal setup only allows for 1 screenshot I want to name the screenshots in a way that makes them unique and also reflect the usage. I can make ...
0
votes
1answer
36 views

How to test confirm popup by cucumber in Ruby on Rails

I am trying to test a feature of my app in Ruby on Rails by Cucumber and Capybara: when you click "delete" button, there is a confirm says " Are you sure?" Then it is supposed to click "OK". At first ...
1
vote
0answers
29 views

ActionController::InvalidAuthenticityToken on Capybara with RSpec test

One of my RSpec tests is throwing an ActionController::InvalidAuthenticityToken error when clicking on a button to send an email. I have tried adding: skip_before_action :verify_authenticity_token, ...
0
votes
1answer
21 views

What is the better and faster approach to test button click in Capybara?

What is faster and more proper approach for testing button click in Capybara? I was looking for it in the docs, but there is nothing about speed and performance for both methods. find('button[name="...
0
votes
2answers
29 views

How to click on one of links with the same text using Capybara in Rails 5

I am testing the user management feature of my app on Rails 5 by cucumber and capybara. In the Users page, all users are listed and there is a "delete" link for each user. I have no idea about ...
0
votes
1answer
22 views

Capybara RSpec matchers waiting for elements?

When writing a test framework/tests using Capybara + RSpec I came across this suggestion for testing for an element NOT to exist: expect(page).to have_no_button('Save') # OK expect(page).not_to ...
0
votes
1answer
45 views

Capybara fails with NotSupportedByDriverError

I'm trying to verify download csv works in my rails application. But its throwing the error Capybara::NotSupportedByDriverError: Capybara::Driver::Base#response_headers it 'exports as CSV' do ...
0
votes
1answer
43 views

How to make JS via webkit work the same as via chromedriver?

There's a JS code which works fine via chromedriver but does not work via webkit. I've found that the following JS not work via webkit because of the object's keys which contain numbers var ...
0
votes
1answer
45 views

Clicking on an input with capybara

I was wondering how to click on a input in capybara. So far I've tried click_on('#js-emu-submit.button.pl3.pr3.mb0.mr1') click('js-emu-submit') find('input', exact_text: 'Get an Estimate', match: :...
1
vote
1answer
48 views

Page Object Model, how discrete are the methods?

So i've been implementing PoM on a new project, it'll be my first time doing so. Im using Capybara with Rspec (Selenium) to write my framework. One thing I keep running into is how "discrete" I ...
0
votes
2answers
39 views

Capybara selenium_chrome going to example.com instead of localhost

I am setting up Cucumber tests in a Rails project. Everything works fine when I use the default driver; but, when I try to use the :selenium_chrome driver, the browser tries to load example.com ...
0
votes
1answer
47 views

RSpec/Capybara without Rails Setup for Page Objects/Support Files?

So im going to be writing a framework that uses Rspec/Capybara and Selenium to do some automation testing on an app. Im using purely RSpec (no rails) and im having some difficulties in getting ...
0
votes
1answer
35 views

Capybara Upgrade Capybara::Query

I have an old project with Capybara version 2.7.1. One file has the following code module Capybara module Node module Finders def all(*args) using_wait_time 1 do xpath = ...
1
vote
1answer
54 views

Capybara / Ruby - Trying to return all tags and html attributes

Trying to return all tags with all attribute values, however just some of them is being returned. describe 'Html', :html do before(:each) do visit 'https://www2.losango.com.br/' end it '...
0
votes
1answer
49 views

Capybara / Ruby - Trying to return to the beginning of the loop when an error shows up

I'm trying to return to the loop beginnig when an error shows up as the code below. I'm using the command "next" when a casual error occurs but it is not coming back for the loop beginning. describe ...
0
votes
1answer
40 views

Using capybara to select a button without an id or value

I don't know how to click on a button that has no id or value. I've already tried using the xpath and selector paths but neither worked for me. <div class="button js-vehicle-section-next full-...
0
votes
1answer
29 views

select(“Acura”, :from=>'js-emu-make-id', visible: false) is not reflected when running save_and_open_page. It still appears to be blank. Why?

I am practicing/testing capybara and ran into a problem with selecting items from a dropdown menu. The way the website works is that you can only go to the next dropdown if you filled in the one ...
0
votes
1answer
45 views

Why is there no “scroll down/up” functionality with Selenium Webdriver?

Every implementation of scrolling I have seen requires executing Javascript (scrollTop, scrollTo for example), rather than an available method in Selenium Webdriver to perform this action. Since ...
0
votes
0answers
38 views

Capybara / Ruby - How interacting with chrome plugins

I'm trying to click on some chrome plugins to interact with it in my Capybara/Ruby/Rspec script. Is that possible? Or capybara scripts will just work in online interactions/urls.. Thanks!
0
votes
1answer
68 views

Cannot connect to websocket when using capybara and docker-chromedriver

When running through capybara test, my tests fail when I need a response from a websocket, this pops up in the console.log: WebSocket connection to 'ws://127.0.0.1:3001/cable' failed: WebSocket is ...
0
votes
1answer
20 views

[selenoid][capybara][rails] Can we use selenoid with Rack App

In Rails when we use capybara with selenium then by default they run the rack server for our rails app and we can test it without running the actual app. So let me explain what does it mean: so when ...

http://mssss.yulina-kosm.ru