6

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..1000} Tutorial videos: https://www.youtube.com/playlist?list=PL284C9FF2488BC6D1 Text tutorial: http://www.gnu.org/software/parallel/parallel_tutorial.html Your ...


4

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 are a number of factors you need to take into account. Don't block CI - You should be limiting the continuous run suites to a basic smoke test run on the CI ...


4

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 Selenium script in to Cucumber script. So my opinion you should continue scripting with as usual Selenium for existing functionality, because It's easy to ...


2

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 rock-solid solution. re @Stanislav Bashkyrtsev answer: but to create randomized test which adapt to existing data is more work (== more possibility to add a ...


2

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 was not able to find the element to then click on. The solution was to scroll to the area of the page where the element existed by finding a nearby element ...


2

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 the script to be executable with chmod +x run_spec_100_times.sh The use it with . run_spec_100_times.sh


2

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 straight code and not a utility or encapsulated framework layer. You would need to build one yourself or integrate with an existing one. Selenium is a code ...


2

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 and controller tests. How much and what to test vary from place depending on what your built, your adherence to a rest model, etc. Try to put logic in models ...


2

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 to run the spec many times to have a sense for whether a 'fix' has worked. This makes addressing them hard. It requires a variety of techniques and approaches ...


2

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.


2

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'. Minitest integration rspec-expectations is a stand-alone gem that can be used without the rest of RSpec. If you like minitest as your test runner, but prefer ...


2

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 Request you can see examples that I wrote, showing how the aforementioned gem separates clearly the page object components, its functions and how to use them with ...


1

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/#navigation. Unfortunately, if you're using Chrome the "interactive" page load strategy won't be supported until Chrome/chromedriver 77 but you could configure a driver ...


1

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', 'project' => 'my-project-name', 'build' => "1.5.15", 'name' => "#{scenario.name}", 'device' => 'Google ...


1

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 pressed the button but the next screen wasn't triggered. Try to add a timeout before you press the submit button. Maybe 30 seconds, you can reduce this later, ...


1

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.google.com' end Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, browser: :chrome) end class RunIt include Capybara::DSL def ...


1

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 more future proof, if you do want add more tests for alternative scenario's it should take less effort. Without a proper implementation that supports re-...


1

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 Debian based systems: apt-get install xvfb Redhat based systems: yum install xorg-X11-server-Xvfb Run the script: xvfb-run ruby headless.rb Executing the ...


1

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 instructions listed here: https://gist.github.com/luislavena/f064211759ee0f806c88#manual-solution-to-ssl-issue Basically you create a new '.pem' file and save it ...


1

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 feature specs had issues with this fix which I am addressing separately. Looks chromedriver is the moving piece where the fixes happen right now.


1

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. Switch the backend your tests run against from fast headless mode to an actual browser with no changes to your tests. Powerful synchronization features mean you ...


1

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 read the basics of Ruby , Cucumber , etc. Write basic programs to get a grasp on the fundamental concepts. From there go 1 level up keep increasing the complexity. ...


1

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. Seems the SitePrism documentation and examples are quite clear what sections are used for: define sections used on multiple pages or multiple times on one page ...


1

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 and installed Jenkins via: sudo apt-get install jenkins This immediately set up jenkins with a user on the AWS Ubuntu install. I found out that, while on ...


1

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 visible Wait element to be clickable Find and Click element etc It will be ugly. So for example you could do something like this : void Wait(Element) { ...


1

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 might can do is - if we have seen element on page means that will be identified by program/code too. Don't believe only on eyes, Good if we right code considering ...


1

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 external scripts - you'd have to write and maintain them separately. Even more - you'd have to not forget to run them from your local machine. This doesn't solve ...


1

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 applications it's now usually placed in spec/support/capybara.rb:, e.g. Capybara.javascript_driver = :selenium


1

Capybara is a Ruby framework used for emulating a users behavior in a browser. You can use it with whatever test framework you wish, RSpec, minitest, etc. When using Capybara, as long as you stick to its API (no calling of methods directly on the driver) you should be able to switch between different drivers relatively painlessly, using the selenium ...


1

Firstly, you should separate your process from your technology stack. Evidently, you've defined a process for yourself: you'd like to write tests that you can execute manually to verify certain things and that you can later use in unattended runs to verify those same things. Now you need to find a technology stack which will let you do this. Now, given your ...


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