12 votes
Accepted

How can I run one spec 100 times using the command line?

If you are using zsh shell: repeat 10 { command } On basic shell: for _ in {1..10} do command; done If you can run the tests in parallel, you can use the GNU Parallel: parallel command ::: {1.....
João Farias's user avatar
  • 10.9k
6 votes
Accepted

PoM Design/Architecture questions

To answer your questions: You are correct in that Page Objects are classes and inheriting from a base/parent class is good. When it comes to selectors, the most common option is to have them be ...
Lee Jensen's user avatar
  • 2,131
4 votes
Accepted

Non-headless Automation Testing on CI Server?

The short answer: No, it is not crazy, as long as you take the proper precautions. The longer answer: There's nothing inherently wrong with running UI automation from a CI server. That said, there ...
Kate Paulk's user avatar
  • 31.5k
4 votes

Writing Automated tests that don't need Cucumber?

I think you should continue with your script using Selenium for existing functionality. Once your all sites development work is completed, I mean once your all modules are ready then It's easy to move ...
Bharat Mane's user avatar
  • 6,785
3 votes

Why are intermittent browser automation failures hard to fix and how to overcome that?

Intermittent failures are hard to fix due to their very nature - they don't always happen. So when you think you have fixed them you often can't be sure just by 'running the spec'. You usually need ...
Michael Durrant's user avatar
3 votes
Accepted

How to use capybara against an external site without rails or rspec?

This will work: require 'capybara' require 'capybara/dsl' require 'selenium-webdriver' Capybara.configure do |c| c.run_server = false c.default_driver = :selenium c.app_host = 'http://www....
Michael Durrant's user avatar
3 votes
Accepted

Using existing framework for new PoM framework bad practice?

Fair warning: this is my opinion based on practice: if it does what you need and doesn't introduce too much of a maintenance burden, it's not bad practice. Your goal is to build scripts that a ...
Kate Paulk's user avatar
  • 31.5k
2 votes

Deleting created data from Automated Tests?

Why not just delete whole database and copy it from clear master copy? Unless you want to test deleting those artifacts, wiping the whole database and replacing it with a clean copy seems fastest and ...
Peter M. - stands for Monica's user avatar
2 votes
Accepted

Why does my capybara element.click not work in Safari?

After working on this for a few hours with a colleague and doing some in-browser debugging in Safari we came to the following conclusion: The element was not visible ('below the fold') and Safari ...
Michael Durrant's user avatar
2 votes

How can I run one spec 100 times using the command line?

Create a script in your home directory, e.g. $ cat run_spec_100_times.sh cd ~/eq/lynx for i in `seq 1 100`; do rspec spec/features/survey_spec.rb done cd ~ Modify ...
Michael Durrant's user avatar
2 votes
Accepted

Selenium integration testing on Node?

I would recommend you study Selenium javascript http://seleniumhq.github.io/selenium/docs/api/javascript/index.html and also read up on node.js https://nodejs.org/en/docs/ which is utilized. This is ...
mutt's user avatar
  • 1,693
2 votes
Accepted

Writing Automated tests that don't need Cucumber?

I would go with rspec using capybara as effectively the next 'layer' down. Your existing experience should make it relatively easy. Make sure your UI tests are backed with a reasonable amount of model ...
Michael Durrant's user avatar
2 votes
Accepted

Page Object Model with Ruby and Selenium(Capybara)?

Even though you might not be re-using elements on multiple pages, or re-use the same pages for different tests (that's how I understand it), I would say using the POM still has benefits: The code is ...
Pieter A's user avatar
  • 323
2 votes

Page Object Model with Ruby and Selenium(Capybara)?

POM can be useful to avoid unnecessary refactoring. For your development stack I would suggest installing the site_prism gem - it allows you to easily create and compose page objects. In this Pull ...
João Farias's user avatar
  • 10.9k
2 votes

Why do rspec-capybara chrome tests run headless fail on my mac and how to diagnose/fix it?

To debug, first try to take a screenshot in headless mode when you arrive at the button. Then take another screenshot before the test fails or after you click the button. It really looks like you ...
newsn31's user avatar
  • 609
2 votes

How to emulate right click options by Capybara?

If it's the system right click menu then you can't. If it's a page generated right click menu then you just interact like any other element on the page.
Thomas Walpole's user avatar
2 votes
Accepted

What would switching from ruby rspec to minitest involve?

Minitest and Rspec are very similar. You are likely to miss the Rspec matchers, however there is an Rspec matchers gem for minitest. If you use it, there is a good chance your test will 'just work'. ...
fmorales's user avatar
  • 181
1 vote

Stop page load, or visit page without waiting for full page load -Capybara

What visit waits until is determined by the specific driver used (chromedriver, geckodriver, etc) and the page load strategy that driver is configured to use - https://w3c.github.io/webdriver/#...
Thomas Walpole's user avatar
1 vote

Display scenario/test names in Browserstack

Take a look at the following example of caps object in capabilities which I use on my tests: { 'automationName'=> 'Appium', 'browserstack.appium_version' => '1.11.1', ...
roman's user avatar
  • 86
1 vote

How to use xvfb to run my automated rspec-capybara chromedriver tests?

This link explains Firefox browser testing with Capybara: Hope the below link give you an insight of the approach. http://elementalselenium.com/tips/38-headless Installing xvfb: Example command : For ...
Bhavani's user avatar
  • 724
1 vote
Accepted

ERROR at the time of capybara installation

The reason for this issue is because - There is an 'SSL' certificate error. When you try to connect to the 'rubygems.org' server via the command prompt, What you need to do is follow the ...
Narendra Chandratre's user avatar
1 vote
Accepted

Running tests in chrome but just getting data;. in every browser window

This was due to a bug in chromedriver. Updating to a more recent version solves this. Specifically this was fixed in chromedriver version 2.24 at least for Ubuntu. A couple of other of our ...
Michael Durrant's user avatar
1 vote
Accepted

Are there advantages to using Capybara with RSpec + Selenium?

I think the Capybara benefits sum it up nicely: No setup necessary for Rails and Rack application. Works out of the box. Intuitive API which mimics the language an actual user would use. ...
Niels van Reijmersdal's user avatar
1 vote

Advice for an experienced manual tester for working with Ruby automation

I have not worked on Cucumber/Ruby (I work on Selenium-Java) so I will restrain myself from suggesting you any books regarding that but what I can tell you is start small. By starting small I mean ...
Alok's user avatar
  • 760
1 vote
Accepted

What is the use of section in siteprism? Is it similar to page object model of selenium webdriver?

Page objects and Sections do not relate to Selenium in anyway. They are building blocks for structuring your automated UI test-cases and can be combined with Selenium if that is your test-driver. ...
Niels van Reijmersdal's user avatar
1 vote
Accepted

AWS EC2 - Cucumber, Selenium-Webdriver, Capybara, Ruby, **Jenkins** - Not a File "/usr/bin/chromedriver"

Okay, so I really was stuck and I couldn't figure it out; so I decided to try something different. I disabled the docker image holding my Jenkins instance and instead loaded up my Apache2 Web server ...
Raisus's user avatar
  • 151
1 vote
Accepted

Preferred methods of finding elements using Capybara + Poltergeist

To work around element not found errors (when you are sure element should be found) you should add waits for element before you actually click on it. But if you do it like this: Wait element to be ...
George's user avatar
  • 1,412
1 vote

Preferred methods of finding elements using Capybara + Poltergeist

Q.1 Sometimes "click_button" or "choose" (for radio buttons) does not work. Even when an ID/name is clearly shown in the HTML & it'll throw an element not found? Ans - One basic mistaken we ...
Narendra Chandratre's user avatar
1 vote
Accepted

Deleting created data from Automated Tests?

Do not clean data Usually it adds more problems than it solves: If you clean data in tests, the tests may fail (e.g. process is killed) and thus the DB won't be clean. If you clean data with ...
Stanislav Bashkyrtsev's user avatar
1 vote
Accepted

Where should 'requires' be kept with regards to rails Automated testing?

I think it depends largely on: whether this is a standalone testing app or part of a rails application. if part of a rails application, which rails version was originally / currently used. In rails ...
Michael Durrant's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible