Does Geb support multi browser testing? - grails

I would like to ask if Geb supports multi browser testing. i.e. testing same scenario at a time in two different browser on one execution?

geb is built on top of Selenium WebDriver which supports most browsers. See here for geb config for various browsers

I just posted and example app for this. you can create a gradel task to spin through and execute the tests for each browser in the gebconfig. Firefox is a bit of a mess at the moment. link why is provided in the sample gebconfig
https://github.com/basejump/grails3-geb-example

Related

Unknown Format in feature testing rails capybara

I am writing capybara tests. There is a link I have in the view. When I click over the link that links open a pop-up js warning. I have configured Js. in capybara by using phantomjs and petergiest gem.
Without the requested information it's impossible to give an exact answer, but the error you are seeing means the app is requesting a non-JS response (probably HTML). This could be occurring for a couple of reasons
You're not actually running the test with a JS supporting driver. I don't see any js metadata on your scenarios so depending on how you've configured Capybara/RSpec this could by your issue. To confirm, swap from Poltergeist to using Selenium with Chrome or Firefox (non-headless while trying to debug) so you can see if the browser actually starts
You have a JS error preventing JS from running so a normal request is being made instead of XHR. This could be because you actually have a bug in your JS or because you're using Poltergeist/PhantomJS which is massively out of date in JS/CSS support. To test this, swap to using Selenium with Chrome or Firefox and look in the developer console.
Your link isn't correctly configured to make an ajax request - This is impossible to tell without the HTML of the link
Additionally, neither of the tests shown in your image are actually asserting/expecting anything so it's very unclear what exactly you're trying to test.

Can Selenium webDriver Python bindings test a Ruby on Rails website?

Can Selenium webDriver Python bindings test a website developed in Ruby on Rails ? Also will I be able to use Firebug to know the id etc. of the webwlements of that website? I am very new to web test automation. Any help would be appreciated.
Can Selenium webDriver Python bindings test a website developed in Ruby on Rails ?
Yes, but if you write the tests in the code of the project if you encounter any issues you could always ask a dev who is familiar with the code base. When you use another language you're risking having a resource familiar with the language to ask.
Also will I be able to use Firebug to know the id etc. of the webwlements of that website?
Yes you can use firebug to find the css id, xpath, etc. If you're using Chrome the web developer settings has these features built in.
It doesn't matter for the driver whats the underline technology powers the site under test. That being said if you want to hook up into the back end for better reporting etc it would be easier to do with the same language

Does Grails have any plugins similar to the django-debug-toolbar (djdt)?

Does Grails have any plugins with functionality similar to the django-debug-toolbar (djdt)?
See this screencast for an introduction to djdt.
Why yes it does grails debug-toolbar:
Grails Debug Toolbar is a plugin
inspired from Django Debug Toolbar
While it doesn't have all the features of djdt it is planned to expand the feature set in the future, here is relevant section from their webpage:
Future work
Currently the views of debugtoolbar
need to go in the grails-app/views of
the application. When you install the
plugin they are automatically copied
to your application grails-app/views.
Need to avoid this.
JavaScript and
static resources for the toolbar
reside in web-app/debugtoolbar. It is
also copied to your application
web-app/debugtoolbar. Need to avoid
this.
A way of ordering the panels in
the toolbar. Currently it is random
depending on how beans are found
during execution of tag.
More useful panels such as Timing the requests, SQL queries, logging etc
It not quite a toolbar (and not a plugin) but Spring Insight gives you detailled request timing right down to the JDBC level. It integrates pretty nicely with Spring Tool Suite from what I've seen.
Check out Peter's screencast: http://www.grails.org/blog/view/pledbrook/New+screencast%3A+Profiling+with+STS+%26+Spring+Insight
You need to deploy your app to Spring's tcServer rather than a plain tomcat which might be fine for development tuning.
cheers
Lee

How to use springsource tool suite for spring web service development?

How to use springsource tool suite for spring web service development?
quick start of how link/guidance is required
Here is a link showing almost everything step by step and you can even see the famous Spring logo in the IDE showing he's using STS: http://briansjavablog.blogspot.com/2013/01/spring-web-services-tutorial.html
http://www.springsource.com/developer/sts

Unit Testing rich Views for ASP.NET MVC

If I have a rich AJAX-driven GUI in ASP.NET MVC, how would I unit test that effectively using a framework like NUnit?
If you're looking to test the functionality of the UI, use browser automation tools like Selenium.
jQuery has a unit testing project called QUnit which you could use to test your ajax code from a client. It isn't going to integrate with NUnit, but it is another option.
With NUnit, you would primarily be testing your controller actions -- i.e., given a set of parameters and a configuration, does the method return the correct result and view model. If you need to test your client-side javascript, you should look at either a javascript unit testing framework or a UI testing tool, such as Selenium or WatiN.
You can use Selenium IDE to record tests and the generate NUnit testcases to verify behaviour and output of your views.
Steve Sanderson also blogged earlier on today about HtmlUnit on .NET as 'headless browser'. (Testing using the Selenium server can be slow, because it requires creating an instance of FireFox, IE etc);
You would have to unit test your ajax calls and not your UI per se., For example if you are getting some json data through a ajax call, this would translate to a controller method which can be unit tested.
I you want to unit test something which happens after the data reaches the browser then its a whole different ball game and not related to MVC.

Resources