Firebug and Selenium: Performance - selenium

I'm a big fan of Firebug - I use it all the time for my web development needs. That said, one of the things I noticed with Firebug is that it significantly slows down the page. In particular, if Firebug is on when a (local) Selenium script is running, the script takes 2-3 times as long to execute, and I sometimes even see timeout errors. Their per-site activation model doesn't help here at all - I'm developing and testing that same site.
I'd like to be able to turn Firebug OFF right before my Selenium script starts, and turn it back on when Selenium is done (or, in the worst case, just keep it off - the biggest annoyance is launching Selenium only to find out that some tests failed for no apparent reason).

My favored solution for this is to make a new, separate Firefox profile (run firefox -ProfileManager), and launch your Selenium scripts using that profile instead. It'll be clean of everything except what you put into it. That way, as little as possible from your personal environment will taint your development environment and you'll maintain a clean separation.

I typically don't run tests from the same machine I develop on. If you can setup a separate test machine where you deploy and run the tests, you can keep Firefox, IE, etc, free of plugins/add-ons like firebug that might get in the way of your tests and avoid this problem completely.
Running your tests on a separate machine also frees your dev machine so that you can continue working while your tests are running. I'm not sure about your situation specifically, but think about when you have hundreds or thousands of test cases running, you don't want to be sitting there waiting for them to finish. You want to be able to work while it runs, view the report it generates, and investigate if necessary.

You could try the alpha builds of Firebug 1.4. The activation/suspend model has changed in this version to a simpler model: it is activated when you see the panel, otherwise it is in suspended mode, see http://blog.getfirebug.com/?p=124 for more information.

Related

Automation job with jenkins is fetching tests from cache but not actually executing them. How to actually execute tests?

We have automation tests that run on jenkins slave, however some times job get's finished successfully showing 100% tests passed but what is happening actually is, these tests are being fetched from cache and not actually getting executed. We don't want this to happen as it is not reliable to depend on some old cache results. Suggest ways to avoid this, thank you.
I have nothing but to disable and enable job, re executing the job but of no use.
Quite strange, the jenkins in each execution runs a new suite, you can check the slave machine and then the browser by clearing the cache. Look closely at the build executions is the number #
check browser
clear cache
clean project on each run
check slave machine

How to run e2e tests automatically?

I really don't know how to ask question to Google about this, so I excuse me that it is naive.
Our team is developing SPA application in ReactJS. We also do back-end programming for NodeJS. Our project recently got more e2e tests. They are written using webdriver.io packages. Everything works as expected but circa 30 tests run about 50 minutes. It is too long to pause developer work and force him to run tests.
We came with the idea that now when we have so many tests, we need to run them on separate computer (other than a developer's laptop, further I call it e2e-laptop).
So I programmed a bash script and installed Ubuntu on a e2e-laptop. My idea is, that developer who wants to run e2e test logs in on e2e-laptop with ssh, runs specified script with arguments (eg: --rev= specific git revision the tests should run on, --email= where to send Allure report) and logs out. After tests are done he gets Allure report in his mailbox.
This all sounds to me OK, but not very well. It works - it is like a dirty MVP. But what I really would like to give my team is the web browser based UI that gives the features my script has. I can imagine this software is hosted on e2e-laptop, every developer can open its webpage address in his local browser. Then after authorization, there are options: run all specs, run chosen specs, send report and more. It would be the best if that software could also allow simultaneous running of tests commissioned by multiple developers.
What software I need?
You need a continuous integration tool. https://stackify.com/top-continuous-integration-tools/
I recommend Jenkins.
I would first try to run your selenium tests headless in a docker container on your laptop. Once you are able to do that, use that same configuration in your docker container running in Bitbucket pipelines. It could actually be the same container and the same scripts. Then, developers can just make a branch and work with the tests on that branch. If only a certain subset of tests need to run, then the developer can make the necessary changes on his or her local branch to run those tests and push it up to Bitbucket. This should help with the configuration https://github.com/SeleniumHQ/docker-selenium.

Nunit3-console : Console.Writeln won't show up

I'm running nunit tests externally via Nunit3-console.
I'm not able to see any console.logs/console.Writeln
I find it mandatory to be able to track in real time, every step of the test.
I've read that nunit3 framework created a parallel test run feature, which is why the real time test output logs have been taken off.
But if I want to enjoy both worlds?
How can I trigger console logs during a test run?
Thanks in advance.
Nunit3 framework doesn't support live hard coded console outputs when running tests from Nunit3-console, because nunit3 framework was meant to bring the parallel testing methodology, they found it pointless to allow such outputs when more than 1 test is running in parallel.
I solved this by downgrading to Nunit 2.6.4 which isnt supporting parallel testing and allows me to fire console outputs from my test.

DropWizard testing

As I am using eclipse and just set up a dropwizard server. On the command prompt I typed in java -jar target/hello-world-0.0.1-SNAPSHOT.jar server hello-world.yml and is running. Yet when ever I make a change to my eclipse file, like changing the yml file for example it doesn't update. I have to crtl+c and re-run what I typed in above. My question is, is there a faster way of testing so that it updates every time I change something or I just have to deal with the testing. Thanks.
Run from within the IDE
Different Java IDEs permit more efficient workflows. For example, in an IDE you can run up your application using a Runtime Configuration that executes your Service.main() method with parameters of server hello-world.yml. This will save you endless Maven builds.
Unfortunately, with Eclipse the hot swapping of code changes is often cumbersome, so I would recommend that you consider Intellij which is more reliable when it comes to hot swapping code. Even then hot swapping can be risky.
Sometimes a restart is unavoidable
That being said, in your situation hot swapping won't help. You are changing the startup configuration file which is only read at startup. You will have to restart to see the changes unless you create your own dynamic-refresh-on-file-hash-change mechanism (not advised).
One alternative is to put much of your configuration testing in unit tests and verify that your code is responding as expected.
Static assets give an optimal workflow (no restarts)
You may encounter a situation where you only want to change static assets (like JavaScript files) in which case Intellij will allow you to simply recompile on the fly and will copy the changed assets into the /target directory and have them immediately picked up by Dropwizard without a restart.
If you wanted to go one step further you could enlist the services of Grunt.js so that it continuously monitored the src/main/resources/assets (or similar) for changes and then automatically update your /target for you. Again, Intellij will autosave on focus change so this would lead to an optimal workflow where you change the asset, wait one second, refresh browser and see the immediate result.
I wrote a lengthy blog article covering Dropwizard and Ember Data a while ago if you want more details on this approach (and single page web application development in general).

How important is it to have a clean test suite on CouchDB?

I recently installed CouchDB, but haven't gotten past the test suite yet. It seems that each time I run it, I get different errors than before, even without configuration changes.
The CouchDB Guide says the test suite shouldn't have "an inordinate number of failures", but what is "inordinate"? How many errors should I tolerate before I start developing?
For reference, here are the errors I'm seeing.
When installed from Ubuntu repository (Runs 1 & 2):
oauth
replication
rev_stemming
security_validation
view_conflicts
Then remedied by removing, then installing from source, as suggested here:
Run 3
attachments
jsonp
Runs 4 & 5
attachments
auth_cache
jsonp
list_views
rev_stemming
Run 6, after clearing cache, then restarting couchdb
No errors!
If each test passes individually, you are all set to proceed with development.
The test suite is not as reliable as we'd like due to its dependence on the javascript engine inside the browser and various timing and other issues. It is mostly used to help the developers validate a release.
We are planning to improve this situation in future releases, most likely by moving the test suite out of the browser entirely and running it from a known environment.
If you do want to see all tests pass, then be sure you are using FireFox (the only browser we officially support for running the test suite itself). You might also find it necessary to clear your browser cache too.