Comments (4)
A simple solution that might work is the following
Create several scenario's for each approach one, for instance:
| scenario | start saucelabs |
| start browser | firefox | on url | http://example.saucelabs.com |
| scenario | start local |
| start browser | firefox | on url | http://example.saucelabs.com | using remote server |
etc...
Now in each test (or in your SuiteSetUp) you start with calling this scenario, but rather than using the name, use a variable:
| script |
| ${startScenario} |
| rest of my test |
| stop browser |
When running the test from your CI system, just start with setting the correct variable for the environment, the rest is done automatically.
Regards,
Cirilo
On 3 nov 2011( w 44), at 11:34, Arjan Molenaar wrote:
I've been running some tests with Sauce Labs today. It strikes me as annoying that I have to change my start-browser command every time I want to test on another environment.
The dependency on browser can be dealt with by defining it as a variable. However I can test to:
- local, using web driver
| start browser | firefox | on url | http://example.saucelabs.com |- local, using selenium server (requires server to be started using SeleniumServerFixture
| start browser | firefox | on url | http://example.saucelabs.com | using remote server |- Remotely, using web driver (e.g. to SauceLabs) (Se2 style)
| Need to come up with something, key-value pairs have to be defined in a Capabilities object and passed to a RemoteWebDriver instance |- Remotely, using Selenium server (Se1 style)
| start browser | { "username": "your name", "access-key": "some-uuid", "os": "Windows 2003", "browser": "firefox", "browser-version": "7", "name": "Testing Selenium 1 from Xebium" } | on url | http://example.saucelabs.com | using remote server on host | ondemand.saucelabs.com | on port | 80 |For each version different statements are included. This makes it very complex to switch from one config to another (in a CI setting it's not possible even).
One solution would be to use the syntax as shown in option 4. and allow that to be used for option 1 as well (they're different code paths now!). The org.json.json package is already included through Selenium-server, so we already have that dependency. Defining a special words
remote-server
with a formatserver:port' will make the
| using remote server |part obsolete. Making
remote-serveran empty string would default to
localhost:4444`.TODO: How to distinguish between WebDriver and Http (Selenium 1) driver?
Reply to this email directly or view it on GitHub:
#23
from xebium.
Fair enough. But the selenium 2 remote (web driver) functionality exposes yet another interface. Of course we can add a new method to the code, but still, it's not ideal.
Having a strict separation between selenium 1 (remote server) and Selenium 2 is a pre, though.
from xebium.
... and how to deal with username and access key? You don't want those directly in your pages.
from xebium.
Maven/ant can take care of the user credentials. Apart from that I think Cirilo's approach is the simplest. It makes it explicit in FitNesse what can be executed.
from xebium.
Related Issues (20)
- Use xebium as a fixture HOT 4
- Open an existing session in Xebium HOT 2
- Xebium is incompatible with ios-driver against a native app HOT 1
- Issue in installing xebium with mvn -Pfitnesse test
- Make code formatting consistent
- Xebium needs Selenium driver 2.46 in order to run with Firefox HOT 2
- Require at least Java 7? HOT 3
- Using Selenium IDE / Xebium on a site with frames? HOT 3
- Running test/suite in parallel HOT 2
- Fix travis build for openjdk6 HOT 1
- Cannot click on an element not currently in the viewport HOT 1
- FitNesse is not shutting down properly HOT 1
- How to define variables for scenarios on a test page? HOT 3
- Sharing a storeText variable between tests in a testsuite? HOT 3
- java code for store and storeEval
- Jenkins->SauceConnect->Desiredcapabilities->Fitnesse HOT 1
- Xebium and Selenium 3 HOT 3
- FitNesse/Xebium set proxy on remoteWebdriver session HOT 2
- ios driver xebium not supported?
- Full-page Chrome screenshots using ShutterBug in conjunction with Xebium HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xebium.