parallel_tests - Ruby multiple browser testing - ruby

So far I have tried running multiple scenarios using parallel_tests and they are working fine. But the problem with this approach is I need to run multiple times with different browser parameter and I think that this is not a good practice.
Right now I am passing only browser parameters along with cucumber config. I can pass array of browsers like 'chrome', 'firefox' , 'ie' etc. Now question is, is there anyway I can trigger all scenarios against all these browsers? parallel_tests should invoke my scenarios? (Lets say 2 scenarios) 6 times (1 scenario against 3 browsers). Is there anyway I can achieve this task?

Related

Run in parallel same cucumber scenario with different parameters provided from Gradle

I'm trying to find resolution on this.
I have 1 cucumber scenario with Gradle parameters: firefoxand chrome
Scenario: Run
When I want browser {browser}
Then I get browser {browser}
How I can run this scenario two times in parallel with Gradle, but with different provided parameters - One test with Firefox and One with Chrome, but in same time.
Behind cucumber, I have Java + JUnit
Thanks

Is there a way to run parallel cucumber tests providing different users to each process

Problem to solve: We want to be able to run multiple ruby cucumber tests in parallel with different users. Since we have user collision in the app, we are not able to use the same user simultaneously.
We tried looking into parallel_test gem to use parallel_cucumber but did not find any way to pass a different user for each process. One option I read online was to have user info in the DB and make a call to get a free user before each test. This was not feasible for us.
Does anyone know any way to make parallel_cucumber or any other ruby gem work to run parallel cucumber tests with a different user for each process
If you are running parallel tests you should be able to use a separate db for each stream. This should avoid the issue of user collisions.

How can I execute same scenario or feature 10 times concurrently in multiple browser to check the performance of website

I have a requirement for the performance of webpage,
example : I have a logging page need to run 10 concurrent execution with different users to test the performance of that page.
I have gone through ruby-jmeter gem but It opened only one browser, but in jmeter log it is showing more than 10 sessions.
Can anyone help on this one
Thank you
To run multiple sessions simultaneously you can use the parallel tests gem: https://github.com/grosser/parallel_tests/
Standard disclaimer: there are a lot of variables in evaluating performance and it is extremely difficult to control those variables sufficiently to get useful information on performance using Selenium or Watir.

Regarding the Chrome and FF multi thread (Process) how to do load test with web protocol?

I wonder if some one solved the issue of browser multi thread with a request response script for load test
If you are going to use real Chrome and FF browsers for load test you can consider the following options:
Selenium Grid
Selenium-Grid allows you run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines running different browsers and operating systems. Essentially, Selenium-Grid support distributed test execution. It allows for running your tests in a distributed test execution environment.
Apache JMeter with the WebDriver Sampler plugin. This way you will be able to control concurrency and get performance metrics in form of HTML Reporting Dashboard.
Simulating web browser concurrency is something most load testing tools do very badly, if at all. We have tried to do this in k6 by letting each VU (virtual user) use multiple, concurrent TCP connections to fetch things in parallel. There is a special API function - http.batch() - that enables this functionality. http.batch() accepts multiple URLs as input parameters, and will fetch as many as possible in parallel.
Like Dmitri writes, Jmeter has a plugin that provides concurrency - sort of. However, what it actually does (unless I'm misinformed) is to spread out requests over multple VUs. Each VU will still only use one concurrent connection, which means that if you e.g. want to simulate 100 real browser users, you may need to fire up 1,000 VUs to do so realistically. This is not very different from what you would get with any other load testing tool, in my opinion: all of them allow you to start more VUs to create more concurrency and more traffic.
I'd say that apart from k6 and maybe one or perhaps two other tools (and Jmeter is not one of them), your only option if you want to really simulate the way browsers behave, is to use Selenium Grid or something similar to fire up a large number of real, actual browsers to do the load testing. The drawback is that real browsers are very expensive to run: they want lots of CPU and memory. But they provide the by far best browser "simulation".

How do I test DelayedJob with Cucumber?

We use DelayedJob to run some of our long running processes and would like to test with Cucumber/Webrat.
Currently, we are calling Delayed::Job.work_off in a Ruby thread to get work done in the background, but are looking for a more robust solution
What is the best approach for this?
Thanks.
The main problem I see with the Delayed:Job.work_off approach is that you are making explicit in your Cucumber scenarios something that belongs to the internals of your system. Mixing both concerns is against the spirit of functional testing:
When I click some link # Some operation is launched in the background
And Jobs are dispatched # Delayed:Job.work_off invoked here
Then I should see the results...
Another problem is that you populate your Cucumber scenarios with repetitive steps for dispatching jobs when needed.
The approach I am currently using is launching delayed_job in the background while cucumber scenarios are being executed. You can check the Cucumber hooks I am using in that link.

Resources