How can we execute single test on multiple browser using browserstack and Geb Framework - testing

I am using Geb framework to execute the testcases on browserstack.Currently I am able to execute my test on single browser(Say Firefox) on browserstack.I need to run the same test on multiple browser

You can use the 'Gradle geb-browserstack Plugin' to run your tests on multiple browsers on BrowserStack. More details available here.
Using this plugin, the capabilities are passed as follows:
browserName_platform_browser-version
For example, to run tests on Firefox 32 on MAC, the capabilities are:
firefox_mac_32
If you have any BrowserStack related queries, you can always get in touch with them at support#browserstack.com
EDIT:
I have created a sample project here, that can help you get started with running Geb Tests in parallel on multiple browsers on BrowserStack.

Related

why do we need to run selenium standalone server for webdriverjs tests?

from selenium docs https://www.seleniumhq.org/docs/03_webdriver.jsp#webdriver-and-the-selenium-server we don't need to run selenium-server if we are using webdriver but almost all javascript automation frameworks need selenium-server to be started before running tests. why do we need to run selenium standalone server for webdriverjs tests ?
This is not true. Given your browser/ driver pair supports directConnect. It will run without the selenium server regardless of the language binding.
For instance, Here is the directConnect reference for protractor. https://github.com/angular/protractor/blob/master/docs/server-setup.md#connecting-directly-to-browser-drivers

How to keep data after headless browser selenium tests are passed?

Currently, we are using selenium for the automation test within our projects. We are using PhantomJs WebDriver to be able to run headless browser tests on bamboo. We want to be able to see the data(or content) which are created and saved by tests using PhantomJs but looks like the content will be gone after that tests are passed.
If we run the tests on Firefox driver without PhantomJs, we can see the content (or data) which is created by tests.
How we could config Phantomjs WebDriver in selenium to be able to see new content (or data) after running tests?
Any suggestion?

Run different test cases on 4 remote machines with selenium

I have 20 test cases, i want to run the first 5 on one remote machine, the other five test cases on the other remote machine....that means run the 20 test cases on 4 different remote machines.
i am using selenium 2.0 webdriver. please tell me how to do it.
What test framework are you using? Although Selenium Grid gives you the ability to run remotely, it is the test framework which provides the mechanism to run in parallel.
Some of the frameworks which support this includes;
Parallel-Test (Ruby) - supports Rspec, Cucumber and TestUnit
TestNG (Java)
JUnit (Java) - I haven't tried it myself as I have always used TestNG in Java
MbUnit (C#)
There may be others

Running a Selenium2 IDE test case on the command line

I need to use the Selenium IDE to create tests for projects we are working on, but to then take these tests and run them from the command line.
The situation is that we want our developers to be able to use the IDE to test websites using a central repository of test suites using the Selenium IDE. We also need the same tests (i.e. in the IDE HTML format) to be run by a CI server (Jenkins) on Sauce Labs.
I have found that the export from the IDE isn't great (test cases that worked on the IDE don't work from the command line). I also need to use WebDriver, e.g Selenium2.
This must be possible but I just cannot see how to do it.
Try out Selunit it combines Selenium tests in Selenese HTML format with Continuous Integration. Here is a tutorial how to execute Selenium tests directly from Selenium IDE in Hudson builds and to benefit from its reporting capabilities provided for JUnit, where Selunit transforms Selenium reports to.
Selenium provides a command-line test script runner, but it's well hidden. Check out the -htmlsuite option of selenium-server.jar.
In windows system you have to download selenium-server-standalone-2.32.0.jar and Browser(IE, chrome) driverserver after downlaod you have to open CMD and run command
java -jar selenium-server-standalone-2.0b3.jar -Dwebdriver.ie.driver=.\IEDriverServer32.exe

is Selenium Remote Webdriver Server similar to Hudson CI?

Right now I am using Hudson CI to launch browser in xvnc and run my tests through Webdriver (pre 2.0)
Should I use Selenium remote webdriver instead? is that more efficient than hudson ci?
I want to run my tests on Amazon....are there any selenium remote webdriver server or Selenium Grid plugin that can already integrate with Amazon? Should I pursue Grid or remotedriver server?
My ultimate goal is to be able to launch multiple tests parallel on Selenium on Amazon and be able to quickly scale up and down.
Right now I pay $100/month for server that has hudson CI on it....but I never end up using the whole capacity....
Grid or the Remote Server does not replace a CI tool like Hudson. They will not schedule jobs, parallelize your tests, report results (with history) or send email/IM notifications when builds fail.
So you would still have Hudson (or similar) for all those things, possibly using Grid or the Remote Server to decouple the machine(s) running the browser(s) from the one running the tests.
Selenium Grid will allow you launch multiple tests in parallel. And with the right configuration you can even run the tests of different browsers in parallel.
Selenium grid is still using selenium 1.x remote control drivers. So if you already have your tests written in webdriver code, then you might not be able to use it with current Selenium grid. There is a new version of selenium grid - Grid 2.0 that will be out soon. That will be support webdriver as well.