Git Product home page Git Product logo

fhoeben / hsac-fitnesse-fixtures Goto Github PK

View Code? Open in Web Editor NEW
109.0 29.0 97.0 4.31 MB

An environment to define and run integration tests. It contains Fitnesse fixture (base) classes and a baseline FitNesse installation.

License: Apache License 2.0

Java 73.98% HTML 24.00% FreeMarker 0.01% Shell 0.09% CSS 0.94% JavaScript 0.67% Dockerfile 0.20% HCL 0.11%
integration-testing fixtures fitnesse-fixture selenium soap rest hsac-fitnesse-fixtures

hsac-fitnesse-fixtures's Introduction

hsac-fitnesse-fixtures

Maven Central

This project assists in testing (SOAP) web services and web applications by providing an application to define and run tests. To this end it contains a baseline installation of FitNesse (an acceptance testing wiki framework) and some FitNesse fixture (base) classes.

The fixtures provided aim to assist in testing (SOAP) web services and web applications (using Selenium) minimizing the amount of (custom) Java code needed to define tests.

The baseline FitNesse installation offers the following features:

  • Ability to easily create a standalone (no JDK or Maven required) FitNesse environment.
  • Run FitNesse tests on a build server, reporting the results in both JUnit XML format and HTML.
  • HSAC's fitnesse-plugin to add additional Wiki features (random values, calculating relative dates, Slim scenarios without need to specify all parameters, Slim scripts that take a screenshot after each step).
  • Praegus' toolchain-plugin, improving the wiki's look and feel and page editing features, combining:
  • FitNesse installation for test/fixture developers containing:
    • the fixture base classes (and Selenium drivers for Chrome, Edge and Firefox),
    • easy fixture debugging.

The fastest way to get started: just download the 'standalone.zip' from the Releases, extract, run it (you'll just need a Java runtime) and explore the example tests and maybe add a couple of your own.

To create your own test project

When you want to use the project's baseline to create and maintain your own test suite, we recommend creating your own Maven project based on the project. This will allow you to run and maintain your test set, in version control, without the need to keep your own copies of dependencies (neither Selenium WebDrivers nor Java libraries).

To create a Maven project to run your own tests, based on this project's baseline (assuming you already have a working Maven installation:

  • Go to the directory below which you want to create the project.
  • Use the archetype, nl.hsac:fitnesse-project, to generate the project:
    • (Maven should find the latest version of the archetype automatically, but it doesn't always.) Check the latest version number on the releases page, and use this instead of <latest-version> in the next command.
    • On the commandline execute: mvn archetype:generate -DarchetypeGroupId=nl.hsac -DarchetypeArtifactId=fitnesse-project -DarchetypeVersion=<latest-version> (or use your IDE's ability to create a project from an archetype).
    • Answer the prompts for 'groupId', 'artifactId' and 'package' for the project.
  • Alternatively you could also manually copy and update a sample project:
    • Clone or download the sample project to a new directory. (This is the approach used in the Installation Guide.)
    • Update the 'groupId' and 'artifactId' in the pom.xml downloaded as part of the sample to reflect your own organisation and project name.
    • Move the file for Java class FixtureDebugTest to a package/directory of your choice.
  • Start the wiki, as described in the generated project's README.md.
  • Start writing tests (and custom fixtures if needed)...

To create the standalone FitNesse installation:

Execute mvn clean package -DskipTests, the standalone installation is present in the wiki directory and as ...-standalone.zip file in the target directory. It can be distributed by just copying the wiki directory or by copying and extracting the zip file to a location without spaces in its own name, or in its parent's names). This standalone installation can be started using java -jar fitnesse-standalone.jar from the wiki directory (or directory where the standalone.zip was extracted).

A zip file containing released versions of this project can be downloaded from the Releases or Maven Central. A similar zip file containing the latest snapshot (i.e. not released but based on the most recent code) version is published as part of the automated build of this project at https://fhoeben.github.io/hsac-fitnesse-fixtures-test-results/hsac-fitnesse-fixtures-snapshot-standalone.zip.

To run the tests on a build server

Tests can be run on a build (or Continuous Integration) server in two ways. One can either gather the dependencies, compile and run tests using a build tool such as Maven or Gradle. Or one can use a docker container which contains a compiled version of the project, add the wiki page to that and have it run tests.

Running using Maven

Have the build server checkout the project and execute mvn clean test-compile failsafe:integration-test. Append failsafe:verify to the command if you want the build to fail in case of test failures. The result in JUnit XML results can be found in: target/failsafe-reports (most build servers will pick these up automatically) The HTML results can be found in: target/fitnesse-results/index.html

The FitNesse suite to run can be specified by changing the value of the @Suite annotation in nl.hsac.fitnesse.fixture.FixtureDebugTest, or (preferably) by adding a system property, called fitnesseSuiteToRun, specifying the suite to run to the build server's mvn execution. By using the @SuiteFilter and @ExcludeSuiteFilter annotations, or (preferably) by adding suiteFilter and/or excludeSuiteFilter system properties, one can provide tags to in- or exclude and further filter the tests to run within the specified suite. Provide multiple tags by comma-separating them.

When multiple test runs are done (for instance in parallel to reduce total execution times) one should configure the the HTML output directory for each run to be a subdirectory of a common root (e.g. target/fitnesse-results/run1 and target/fitnesse-results/run2) and then use nl.hsac.fitnesse.junit.reportmerge.HtmlReportIndexGenerator to generate a combined overview of all runs.

The Selenium configuration (e.g. what browser on what platform) to use when testing websites can be overridden by using system properties (i.e. seleniumGridUrl and either seleniumBrowser or seleniumCapabilities). This allows different configurations on the build server to test with different browsers, without requiring different Wiki content, but only requiring a different build configuration.

Running using Docker

Using docker one can start a container (i.e. virtual machine) containing a compiled version of the project and have it execute the tests defined. The main advantage of this approach is there is no need to gather dependencies and compile on each test run. This can be quite advantages when running builds on fully virtualized infrastructure where no state is maintained between runs, and all dependencies have to be downloaded afresh each run.

The way the actual tests are run is quite similar inside a docker container to what was described above for 'Running using Maven' in that a jUnit test is executed to run a suite of wiki pages. Which suite is executed, filters to include and exclude, and Selenium can be configured without modifing the images provided.

Two images are provided on Docker Hub to run tests (or to be used as base for custom images, of course):

  • hsac/fitnesse-fixtures-test-jre11 which contains a Java runtime and this project, which can be used to run tests that either do not need Selenium (i.e. do not test using BrowserTest) or use an existing/external Selenium Grid.
  • hsac/fitnesse-fixtures-test-jre11-chrome which adds this project to a Selenium standalone Chrome image and can be used to run tests with a Chrome browser (without the need to have/maintain a Selenium Grid).

An additional image is provided to combine multiple test run's results: hsac/fitnesse-fixtures-combine.

Detailed instructions on how to use the images are provided in each image's description.

The automated build process also generates docker images for each commit in GitLab's docker registry, so if you want the latest code snapshot in an image you can get that there. The master branch updates the 'latest' images, other branches have a tag based on their name. Please note: these images are temporary, and subject to periodic cleanup.

Reports

The automated build process of this project generates some reports which can give an impression of the reports generated from test runs. The project's acceptance tests and examples both cover multiple runs in a single report. Clicking on a run's name in the 'Overview Pages' table takes you to a single run's test report.

Fixture developer installation:

Import this project in your favorite Java IDE (with Maven support).

To start FitNesse: have the IDE execute mvn compile dependency:copy-dependencies exec:exec. The port used by FitNesse can be controlled by changing the fitnesse.port property's value in pom.xml. FitNesse will be available at http://localhost:<fitnesse.port>/, example usage of the symbols and fixtures can be seen in http://localhost:<fitnesse.port>/HsacExamples.

To debug a fixture used in a FitNesse page: change the @Suite annotation's value in nl.hsac.fitnesse.fixture.FixtureDebugTest to contain the page name, then just debug this test.

Documentation

More information about this project can be found on its GitHub Wiki

hsac-fitnesse-fixtures's People

Contributors

aukeroze avatar boxleytw avatar danielmenezesbr avatar daveychu avatar dependabot[bot] avatar fastigium avatar fhoeben avatar gdasai avatar greg73 avatar haroon-sheikh avatar hboutemy avatar ilseh avatar jessefspecialisterren avatar joroelev avatar keetron avatar lennyg1 avatar maartenjanvangool avatar ordtesters avatar pvbemmelen62 avatar renzoh89 avatar romancha avatar roydekleijn avatar sb185219 avatar sglebs avatar taxanas avatar tcnh avatar teunisnl avatar timovd avatar vegterb avatar wvanmourik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hsac-fitnesse-fixtures's Issues

Req: Is Visible on website

Simply: ability to check if text/element is visually present anywhere on current page (regardless if its currently on the screen)

Long:
The current | is visible | has its perks if you wanna make sure if an element is on screen.
but its more often I would prefer the option | is visible | would have a build in |scroll to|
for compatibility a |is visible on page| would be great.
and yeah i know i could solve this by addind a scroll to, so it would be more perk then a must have

Alert problem - org.openqa.selenium.UnhandledAlertException: Unexpected modal dialog

Driving a desktop Windows Firefox browser, when an "OK / Cancel" alert box is popped up,
the alert flashes, disappears, and the browser test script immediately fails with an exception:

org.openqa.selenium.UnhandledAlertException:
Unexpected modal dialog (text is: are you sure, etc., etc.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
...
at nl.hsac.fitnesse.fixture.util.SeleniumHelper.executeScript(SeleniumHelper.java:483)

I am using-
"Driver info: org.openqa.selenium.firefox.FirefoxDriver",
selenium-api-2.47.1.jar (selenium-remote-2.47.1.jar, selenium-support- 2.47.1.jar)
selenium-firefox-driver-2.47.1.jar

Is there a need to use another version, or call some set-up to make the alert box stay up?

Thanks!

JUnitXMLPerPageListener no longer reports failures

With the 2.7.0 release the JUnitXMLPerPageListener no longer reports failed or errored tests.

The new FitNesse release always calls testFinished(), which causes the listener to report test success.

Support setting HTTP headers on GET verb

We are writing tests using:

|set value | |for header|Application-Id|

But apparently it doesnt work with a GET. POST seems to work fine (have not tried delete yet).
Could this be implemented in a future build?

Nullpointer when setting null values as prefixes

Since the set operation doesn't check if a null is supplied, but simply sets it, we actually have a key-value pair with key - null.
When we then try to override this key, we get a nullpointer exception, since a check exists to see if it is already a known value which isn't null-proof.
To test: add("key", null); add("key","something")
EXCEPTION:java.lang.NullPointerException
at nl.hsac.fitnesse.fixture.util.NamespaceContextImpl.add(NamespaceContextImpl.java:30) [hsac-fitnesse-fixtures-2.4.1.jar]
at nl.hsac.fitnesse.fixture.Environment.registerNamespace(Environment.java:356) [hsac-fitnesse-fixtures-2.4.1.jar]
at nl.hsac.fitnesse.fixture.slim.XmlHttpTest.registerPrefixForNamespace(XmlHttpTest.java:26) [hsac-fitnesse-fixtures-2.4.1.jar]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88) [rt.

Redirects are automatic followed

When we do a get that follows a redirect we cannot do different checks because
the redirect is automatic followed.
We want an option in fitnesse that we can stop following an redirect

Business selector failing

|script|browser test                                        |
|open  |http://nl.calvinklein.com/store/en                  |
|click |CLOSE                                               |
|click |Sign In/Register                                    |
|click |REGISTER                                            |
|enter |New York              |as       |City *             |
|enter |9999 AA               |as       |Postal code *      |
|show  |take screenshot       |Foto_1                       |
|note  |expected 9999 AA in postal code,result nothing there|

|script|browser test                                             |
|open  |https://www.telfort.nl/persoonlijk/combivoordeel.htm     |
|click |Ja, ik ga akkoord                                        |
|click |Ja, ik heb Telfort producten                             |
|show  |take screenshot                  |Foto_2                 |
|note  |expected Ja, ik heb to be selected,result nothing happend|

These might 2 seperated issues

Always on top + click issue

tested in 2.5.2

As example:
|script|browser test | |open |!-http://www.koffiediscounter.nl/product/1826157/nespresso-delonghi-lattissima-touch-en550s.html-!| |click |xpath=.//*[@id='combination-products-container']/div/div[1]/div[2]/div[2]/a |

I try to click on 2nd "Plaats in winkelmand" but the hover-content is preventing the click
(page timeout also shows this)
a scroll to + page_up can by pass this, but running into same error on input form where an element is selected, so page_up will directed toward the element instead of the page

Req: Ability to get value of specified attribute inside a element

Im trying to acces contens of specified attribute in a element
Tried value of|xpath=(.//input[@value="" and contains(@name,"pcnr")])[1]/@name
but this always return null (xpath is correct)
value of|xpath=(.//input[@value="" and contains(@name,"pcnr")])[1] works and returns a empty string as expected

AngularJS ui-select compatibility

Hi @fhoeben,
I couldn't find a way to make angular-ui/ui-select work with your fixture.
Here's what I did:

!define TEST_SYSTEM {slim}

|Import |
|nl.hsac.fitnesse.fixture.slim |
|nl.hsac.fitnesse.fixture.slim.web |

| script | selenium driver setup |
| start driver for | firefox |
| wait seconds | 3 |


| storyboard | ng browser test |
| note | Downloaded the plunkr example (http://plnkr.co/edit/a3KlK8dKH3wwiiksDSn2?p=preview) and made available through a web server |
| open | http://localhost:3000 |
| enter | Germany | as | country.selected |

I believe the problem is that ui-select uses a div for the select:

<div ng-class="{'open': $select.open}" class="ui-select-container selectize-control single ng-pristine ng-valid open" style="width: 300px;" ng-disabled="disabled" theme="selectize" ng-model="country.selected">
...
</div>

I also tried with select but I get timeout. Here's the stacktrace trying with enter:

__EXCEPTION__:org.openqa.selenium.WebDriverException: Element must be user-editable in order to clear it.
Command duration or timeout: 63 milliseconds
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=38.0.5, platform=MAC, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 9078a78a-5aa8-8741-b00c-25a51556be31
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_40]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_40]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_40]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_40]
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204) [selenium-remote-driver-2.45.0.jar]
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156) [selenium-remote-driver-2.45.0.jar]
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599) [selenium-remote-driver-2.45.0.jar]
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268) [selenium-remote-driver-2.45.0.jar]
    at org.openqa.selenium.remote.RemoteWebElement.clear(RemoteWebElement.java:113) [selenium-remote-driver-2.45.0.jar]
    at nl.hsac.fitnesse.fixture.slim.web.NgBrowserTest.enterAs(NgBrowserTest.java:126) [file:/Users/mqm/git/hsac-fitnesse-fixtures/target/fixtures/]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_40]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_40]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_40]
    at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_40]
    at fitnesse.slim.fixtureInteraction.DefaultInteraction.methodInvoke(DefaultInteraction.java:80) [fitnesse-standalone.jar]
    at fitnesse.slim.MethodExecutor.callMethod(MethodExecutor.java:44) [fitnesse-standalone.jar]
    at fitnesse.slim.MethodExecutor.invokeMethod(MethodExecutor.java:31) [fitnesse-standalone.jar]
    at fitnesse.slim.MethodExecutor.findAndInvoke(MethodExecutor.java:57) [fitnesse-standalone.jar]
    at fitnesse.slim.FixtureMethodExecutor.execute(FixtureMethodExecutor.java:20) [fitnesse-standalone.jar]
    at fitnesse.slim.StatementExecutor.getMethodExecutionResult(StatementExecutor.java:126) [fitnesse-standalone.jar]
    at fitnesse.slim.StatementExecutor.call(StatementExecutor.java:104) [fitnesse-standalone.jar]
    at fitnesse.slim.instructions.CallInstruction.executeInternal(CallInstruction.java:35) [fitnesse-standalone.jar]
    at fitnesse.slim.instructions.Instruction.execute(Instruction.java:29) [fitnesse-standalone.jar]
    at fitnesse.slim.ListExecutor$Executive.executeStatement(ListExecutor.java:49) [fitnesse-standalone.jar]
    at fitnesse.slim.ListExecutor$Executive.executeStatements(ListExecutor.java:43) [fitnesse-standalone.jar]
    at fitnesse.slim.ListExecutor.execute(ListExecutor.java:83) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimServer.executeInstructions(SlimServer.java:84) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimServer.processOneSetOfInstructions(SlimServer.java:77) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimServer.tryProcessInstructions(SlimServer.java:56) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimServer.serve(SlimServer.java:42) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.handle(SlimService.java:186) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.acceptOne(SlimService.java:194) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.accept(SlimService.java:156) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.startWithFactory(SlimService.java:77) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.main(SlimService.java:57) [fitnesse-standalone.jar]
Caused by: org.openqa.selenium.WebDriverException: Element must be user-editable in order to clear it.
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'Marcio-Marchinis-MacBook-Pro-Silver.local', ip: '172.23.70.56', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'
Driver info: driver.version: unknown
    at <anonymous class>.bot.Error(file:///var/folders/ts/c1cr6kcd4yb6s7tj6bjt_nyr0000gp/T/anonymous8726906604216681644webdriver-profile/extensions/[email protected]/components/command-processor.js:4740) [n/a]
    at <anonymous class>.bot.action.clear(file:///var/folders/ts/c1cr6kcd4yb6s7tj6bjt_nyr0000gp/T/anonymous8726906604216681644webdriver-profile/extensions/[email protected]/components/command-processor.js:11290) [n/a]
    at <anonymous class>.WebElement.clearElement(file:///var/folders/ts/c1cr6kcd4yb6s7tj6bjt_nyr0000gp/T/anonymous8726906604216681644webdriver-profile/extensions/[email protected]/components/command-processor.js:11736) [n/a]
    at <anonymous class>.DelayedCommand.prototype.executeInternal_/h(file:///var/folders/ts/c1cr6kcd4yb6s7tj6bjt_nyr0000gp/T/anonymous8726906604216681644webdriver-profile/extensions/[email protected]/components/command-processor.js:12274) [n/a]
    at <anonymous class>.DelayedCommand.prototype.executeInternal_(file:///var/folders/ts/c1cr6kcd4yb6s7tj6bjt_nyr0000gp/T/anonymous8726906604216681644webdriver-profile/extensions/[email protected]/components/command-processor.js:12279) [n/a]
    at <anonymous class>.DelayedCommand.prototype.execute/<(file:///var/folders/ts/c1cr6kcd4yb6s7tj6bjt_nyr0000gp/T/anonymous8726906604216681644webdriver-profile/extensions/[email protected]/components/command-processor.js:12221) [n/a]

I believe your fixture will probably need to be changed to traverse ui-select's children inside the div.

maven enforcer plugin DependencyConvergence check fails for selenium-java

Dependency convergence error for org.seleniumhq.selenium:selenium-java:2.47.1 paths to dependency are:
    +-com.x:y:0.2-SNAPSHOT
      + nl.hsac:hsac-fitnesse-fixtures:2.1.1
    +-org.seleniumhq.selenium:selenium-java:2.47.1
and
+-com.x:y:0.2-SNAPSHOT
  +-nl.hsac:hsac-fitnesse-fixtures:2.1.1
    +-com.codeborne:phantomjsdriver:1.2.1
      +-org.seleniumhq.selenium:selenium-java:2.44.0

Suggested fix in pom.xml:

        <dependency>
            <groupId>com.codeborne</groupId>
            <artifactId>phantomjsdriver</artifactId>
            <version>1.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-remote-driver</artifactId>
                </exclusion>
+               <exclusion>
+                   <groupId>org.seleniumhq.selenium</groupId>
+                   <artifactId>selenium-java</artifactId>
+               </exclusion>
            </exclusions>
        </dependency>

Error clicking a UI element by xpath with ios-driver

I am running this:

!define PROTOCOL {http}
!define url {${PROTOCOL}://localhost:5555/wd/hub}

!define TEST_SYSTEM {slim} 

!define slim.timeout {90}

|Import                            |
|nl.hsac.fitnesse.fixture.slim     |
|nl.hsac.fitnesse.fixture.slim.web |

|script              |selenium driver setup                                                                                                    |
|connect to driver at|${url}|with capabilities|!{device:iphone,language:en,locale:en_US,CFBundleName:!-InternationalMountains-!,simulator:true,variation:iPhone5s,instruments:true}|

|script | browser test |
| click by xPath | //UIATableCell[contains(@name,'Mountain 1')] |

but I am getting an error:

__EXCEPTION__:org.openqa.selenium.WebDriverException: undefined is not a function (evaluating 'arguments[0].getBoundingClientRect()')
Command duration or timeout: 83 milliseconds
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'Marcio-Marchinis-MacBook-Pro-Silver.local', ip: '192.168.33.109', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{aut=/Users/mqm/Downloads/ios-driver/InternationalMountains.app, language=en, CFBundleIdentifier=com.yourcompany.InternationalMountains, locale=en_US, variation=iPhone5s, platform=UNIX, rect={size={width=320, height=568}, origin={x=0, y=0}}, elementTree=true, systemName=iPhone OS, browserVersion=1.0, platformVersion=8.3, takesScreenshot=true, browserName=InternationalMountains, javascriptEnabled=true, iosTouchScreen=true, platformName=IOS, rotatable=true, supportedLocales=[en, fr, zh], simulator=true, cssSelectors=true, version=null, CFBundleVersion=1.0, name=iPhone Simulator, locationContextEnabled=true, sdkVersion=8.3, takesElementScreenshot=false, device=iphone, iosSearchContext=true, configurable=true}]
Session ID: a5e7bf62-faf6-4938-82cf-fa485593896c
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_40]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_40]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_40]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_40]
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204) [selenium-remote-driver-2.45.0.jar]
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156) [selenium-remote-driver-2.45.0.jar]
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599) [selenium-remote-driver-2.45.0.jar]
    at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:508) [selenium-remote-driver-2.45.0.jar]
    at nl.hsac.fitnesse.fixture.util.SeleniumHelper.executeJavascript(SeleniumHelper.java:250) [file:/Users/mqm/git/hsac-fitnesse-fixtures/target/fixtures/]
    at nl.hsac.fitnesse.fixture.util.SeleniumHelper.isElementOnScreen(SeleniumHelper.java:343) [file:/Users/mqm/git/hsac-fitnesse-fixtures/target/fixtures/]
    at nl.hsac.fitnesse.fixture.slim.web.BrowserTest.isElementOnScreen(BrowserTest.java:1015) [file:/Users/mqm/git/hsac-fitnesse-fixtures/target/fixtures/]
    at nl.hsac.fitnesse.fixture.slim.web.BrowserTest.scrollIfNotOnScreen(BrowserTest.java:986) [file:/Users/mqm/git/hsac-fitnesse-fixtures/target/fixtures/]
    at nl.hsac.fitnesse.fixture.slim.web.BrowserTest.clickElement(BrowserTest.java:535) [file:/Users/mqm/git/hsac-fitnesse-fixtures/target/fixtures/]
    at nl.hsac.fitnesse.fixture.slim.web.BrowserTest.clickByXPath(BrowserTest.java:871) [file:/Users/mqm/git/hsac-fitnesse-fixtures/target/fixtures/]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_40]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_40]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_40]
    at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_40]
    at fitnesse.slim.fixtureInteraction.DefaultInteraction.methodInvoke(DefaultInteraction.java:80) [fitnesse-standalone.jar]
    at fitnesse.slim.MethodExecutor.callMethod(MethodExecutor.java:44) [fitnesse-standalone.jar]
    at fitnesse.slim.MethodExecutor.invokeMethod(MethodExecutor.java:31) [fitnesse-standalone.jar]
    at fitnesse.slim.MethodExecutor.findAndInvoke(MethodExecutor.java:57) [fitnesse-standalone.jar]
    at fitnesse.slim.FixtureMethodExecutor.execute(FixtureMethodExecutor.java:20) [fitnesse-standalone.jar]
    at fitnesse.slim.StatementExecutor.getMethodExecutionResult(StatementExecutor.java:126) [fitnesse-standalone.jar]
    at fitnesse.slim.StatementExecutor.call(StatementExecutor.java:104) [fitnesse-standalone.jar]
    at fitnesse.slim.instructions.CallInstruction.executeInternal(CallInstruction.java:35) [fitnesse-standalone.jar]
    at fitnesse.slim.instructions.Instruction.execute(Instruction.java:29) [fitnesse-standalone.jar]
    at fitnesse.slim.ListExecutor$Executive.executeStatement(ListExecutor.java:49) [fitnesse-standalone.jar]
    at fitnesse.slim.ListExecutor$Executive.executeStatements(ListExecutor.java:43) [fitnesse-standalone.jar]
    at fitnesse.slim.ListExecutor.execute(ListExecutor.java:83) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimServer.executeInstructions(SlimServer.java:84) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimServer.processOneSetOfInstructions(SlimServer.java:77) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimServer.tryProcessInstructions(SlimServer.java:56) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimServer.serve(SlimServer.java:42) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.handle(SlimService.java:186) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.acceptOne(SlimService.java:194) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.accept(SlimService.java:156) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.startWithFactory(SlimService.java:77) [fitnesse-standalone.jar]
    at fitnesse.slim.SlimService.main(SlimService.java:57) [fitnesse-standalone.jar]

With my own experimentation little fixture https://github.com/sglebs/BetDevFitNesse/blob/master/src/main/java/net/betterdeveloper/fitnesse/RemoteWebDriverFixture.java it works:

!define PROTOCOL {http}
!define url {${PROTOCOL}://localhost:5555/wd/hub}

!define TEST_SYSTEM {slim} 
!path ./dependencies/*

!define slim.timeout {90}

|import|
|net.betterdeveloper.fitnesse|

|library |
|Remote Web Driver Fixture |

| script |
| start on | ${url} | with capabilities | {"device" : "iphone", "language": "en", "locale": "en_US", "CFBundleName": "InternationalMountains", "simulator": "true", "variation":"iPhone5s", "instruments": "true"} |
| click on element with xpath | //UIATableCell[contains(@name,'Mountain 5')] |
| stop |

Would it make sense to provide support for 'negative' XmlHttpTest(s)?

I just had to create this class because I could not get a green page
when a request caused a SOAP Fault which was in every respect the
response I wanted. Would it be considered if I submitted a pull request
for it with tests?

    public class NegativeXmlHttpTest extends XmlHttpTest {
        @Override
        public boolean responseIsValid() {
            return ! super.responseIsValid();
        }

        @Override
        public String xPath(String xPathExpr) {
            return super.rawXPath(xPathExpr);
        }
    }

set-cookie header returned by application is not fully relayed to fitnesse

Situation: Using the http test, sending a get request to the application.

Expected: the application returns a http code 200, several response headers including a set-cookie-header, containing multiple cookies, and a response body.

Result: response body and http code OK, but the set-cookie header that the application sends back, which exists of two parts, is not completely relayed to fitnesse. Instead, only one part is relayed, making it impossible to check that both cookies are set by the application.

Example:
These headers are sent:
Content-Type: text/html;charset=UTF-8
Content-Language: nl-NL
Set-Cookie:
ABC=ABC%2DID%3DABC00005%26OFFER%2DID
Set-Cookie:
ABC-APP-VARIABLES=REQUEST%3DACTIVE
Transfer-Encoding: chunked
etc

The issue here is that the second set-cookie header DOES make it to Fitnesse but the first doesn't.

Testing electron app

Is there a SeleniumDriverSetup configuration that can be used to test an electron app with ChromeDriver?

Req: deleteAllCookies for all domains

I'm having issue with a website cookiewall, they set a cookie on a 2nd domain, and even if i throw away cookies of main site, the cookie on the different domain will make sure i never get see cookiewall again. making it very hard to suite test the website.

Currently by passing this by restarting the driver in setup/teardown, but for future tests a deleteAllCookies that really clears all cookies would be nice

postTemplateTo() returns error

Hi there,

i'm using your postTemplateTo() method during a test in which I expect a soap error envelope as a response. I used your implementation for "rawXPath" to get the errorcode from the error response, which works without a problem. Nevertheless "post template to" is marked red in fitnesse.
I'd guess this is expected behaviour, since you mention "* @return true if call could be made and response did not indicate error." in the javadoc of the postTemplateTo() method.
Is there a way to supress this?

Yours
Jonas

Exercise an unnamed file upload

Is it possible to direct the web driver to use XPath to find an upload input tag and set a file into it?
The application I am testing has no name or id on the <input type="file"/> tag.

Thanks!

Circular reference between BrowserTest and NgBrowserTest

There is a circular reference (bad) between a superclass and its subclass. BrowserTest has an instance variable which is an NgBrowserTest (its subclass). This means that an instance of an NgBrowserTest will also have a second instance like itself, inherited from the superclass.

click by ID is straightforward with the Xebium bridge but complicated with hsac

Hi @fhoeben

I ran this:

|Import                            |
|nl.hsac.fitnesse.fixture.slim     |
|nl.hsac.fitnesse.fixture.slim.web |

|script              |selenium driver setup   |
|connect to driver at|${url}|with capabilities|{"bundleId":"com.apple.Automator"}|

| script| browser test |
| click | id=_NS:40   |

These are the REST requests:

127.0.0.1 - - [18/Jun/2015 16:11:14] "POST /wd/hub/session HTTP/1.1" 200 87
127.0.0.1 - - [18/Jun/2015 16:11:14] "POST /wd/hub/session/1434654674693/timeouts HTTP/1.1" 200 57
127.0.0.1 - - [18/Jun/2015 16:11:14] "POST /wd/hub/session/1434654674693/timeouts/async_script HTTP/1.1" 200 57
127.0.0.1 - - [18/Jun/2015 16:11:15] "GET /wd/hub/session/1434654674693/window_handles HTTP/1.1" 200 63
127.0.0.1 - - [18/Jun/2015 16:11:16] "GET /wd/hub/session/1434654674693/window_handle HTTP/1.1" 200 61
127.0.0.1 - - [18/Jun/2015 16:11:16] "POST /wd/hub/session/1434654674693/elements HTTP/1.1" 200 54
127.0.0.1 - - [18/Jun/2015 16:11:16] "GET /wd/hub/session/1434654674693/screenshot HTTP/1.1" 404 798
127.0.0.1 - - [18/Jun/2015 16:11:16] "DELETE /wd/hub/session/1434654674693 HTTP/1.1" 200 53

This is the error:

Command duration or timeout: 41 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'Marcio-Marchinis-MacBook-Pro-Silver.local', ip: '192.168.130.30', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{bundleId=com.apple.Automator, platform=ANY}]
Session ID: 1434654674693
*** Element info: {Using=xpath, value=(//label/descendant-or-self::text()[normalize-space(.)='id=_NS:40']/ancestor-or-self::label)[1]}

Note that despite the fact that I am asking for a click by ID, the request being sent to the web driver is more complex (xpath). Unfortunately this web driver I am using does not support xpath as a locator.

With the Xebium bridge I tried this:

|Import                            |
|nl.hsac.fitnesse.fixture.slim     |
|nl.hsac.fitnesse.fixture.slim.web |
|nl.hsac.fitnesse.fixture.slim.web.xebium |

|script              |selenium driver setup   |
|connect to driver at|${url}|with capabilities|{"bundleId":"com.apple.Automator"}|

| script | hsac selenium driver fixture |
| ensure | do | click | on | id=_NS:40 |
| stop browser |

The requests received were:

127.0.0.1 - - [18/Jun/2015 16:16:08] "POST /wd/hub/session HTTP/1.1" 200 87
127.0.0.1 - - [18/Jun/2015 16:16:08] "POST /wd/hub/session/1434654968777/timeouts HTTP/1.1" 200 57
127.0.0.1 - - [18/Jun/2015 16:16:08] "POST /wd/hub/session/1434654968777/timeouts/async_script HTTP/1.1" 200 57
127.0.0.1 - - [18/Jun/2015 16:16:09] "GET /wd/hub/session/1434654968777/window_handles HTTP/1.1" 200 63
127.0.0.1 - - [18/Jun/2015 16:16:10] "GET /wd/hub/session/1434654968777/window_handle HTTP/1.1" 200 61
127.0.0.1 - - [18/Jun/2015 16:16:10] "POST /wd/hub/session/1434654968777/timeouts HTTP/1.1" 200 57
127.0.0.1 - - [18/Jun/2015 16:16:10] "POST /wd/hub/session/1434654968777/timeouts/async_script HTTP/1.1" 200 57
127.0.0.1 - - [18/Jun/2015 16:16:10] "POST /wd/hub/session/1434654968777/elements HTTP/1.1" 200 75
127.0.0.1 - - [18/Jun/2015 16:16:10] "GET /wd/hub/session/1434654968777/element/_NS%3A40/displayed HTTP/1.1" 200 56
127.0.0.1 - - [18/Jun/2015 16:16:10] "POST /wd/hub/session/1434654968777/execute HTTP/1.1" 200 56
127.0.0.1 - - [18/Jun/2015 16:16:10] "GET /wd/hub/session/1434654968777/element/_NS%3A40/displayed HTTP/1.1" 200 56
127.0.0.1 - - [18/Jun/2015 16:16:10] "GET /wd/hub/session/1434654968777/element/_NS%3A40/enabled HTTP/1.1" 200 56
127.0.0.1 - - [18/Jun/2015 16:16:10] "POST /wd/hub/session/1434654968777/element/_NS%3A40/click HTTP/1.1" 200 56
127.0.0.1 - - [18/Jun/2015 16:16:10] "DELETE /wd/hub/session/1434654968777/cookie HTTP/1.1" 200 53
127.0.0.1 - - [18/Jun/2015 16:16:10] "POST /wd/hub/session/1434654968777/execute HTTP/1.1" 200 56
127.0.0.1 - - [18/Jun/2015 16:16:10] "DELETE /wd/hub/session/1434654968777 HTTP/1.1" 200 53

Note that it does perform the lookup based on ID. It never tries to do xpath.

How can I use hsac without the Xebium bridge and have it honor the strategy of an id-based lookup, without requiring xpath support on the remote engine? Only with a custom BrowserTest subclass?

Thanks!

Checken welke na een hover zichtbaar worden.

Het zou handig zijn als het mogelijk is teksten te controleren na middels een hover actie zichtbaar worden.

HTML voorbeeld:

<span class="ra_bh_hovertooltip " title=" <strong>Kosten verrekenen met financiering</strong><br> <div id="row_kostenmeefinancieren_tooltipDiv">Als de kosten worden meegefinancierd, wordt het advies niet los geïncasseerd.</div> ">
<span id="row_kostenmeefinancieren_tooltip" class="infotext">
<strong>Kosten verrekenen met financiering</strong>
<br>
<div id="row_kostenmeefinancieren_tooltipDiv">Als de kosten worden meegefinancierd, wordt het advies niet los geïncasseerd.</div>
</span>
</span>

confirmation dialogs issue

BrowserTest: test web applications using Selenium

I am not able to accept alertAccept() function and upload file function in JAVA web application (jsp,ajax,javascript)
please help me.

Can't pass a boolean capability to the Selendroid WebDriver

Hi @fhoeben ,

I want to test selendroid http://selendroid.io/setup.html and for that I need to tell it to run things in the emulator, so I am using this:

|script              |selenium driver setup   |
|connect to driver at|${url}|with capabilities|!{aut:io.selendroid.testapp, emulator: true}|

Unfortunately I get this error in Selendroid:

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean

and that happens because of this code in Selendroid:

  public Boolean getEmulator() {
    if (getRawCapabilities().get(EMULATOR) == null
        || getRawCapabilities().get(EMULATOR).equals(JSONObject.NULL)) return null;
    return getBooleanCapability(EMULATOR);
  }

  // throws exception if user didn't pass the capability as a boolean
  private Boolean getBooleanCapability(String key) {
    Object o = getRawCapabilities().get(key);
    if (o == null) {
      return null;
    } else if (o instanceof Boolean) {
      return (Boolean) o;
    } else {
      throw new ClassCastException(String.format(
          "DesiredCapability %s's value should be boolean: found value %s of type %s", key, o.toString(), o.getClass()
              .getName()));
    }
  }

So, I need to put a * boolean* in that Hashtable, and not a string. But it does not seem to be possible to do this with FitNesse. Maybe this is why Xebium takes a JSON String?

If that is the case, perhaps you should also support a JSON-based API as well? I used to support it in my test fixture, but recently changed it to be like yours. Look at the red code in sglebs/BetDevFitNesse@f46d9ed#diff-9990a6b7571fd450ab906375e1f1f9da to see how I was supporting the JSON-based capabilities.

Any other suggestions?

set header value for BrowserTest script?

Is it possible to set headers for subsequent "open url" commands in BrowserTest scripts,
to avoid the redirect and delay of a login screen?

This works with "xml http test", but apparently not with "BrowserTest."

Setting Content-type in MockXmlServerSetup?

Is there a way to set the 'Content-type' header in
nl/hsac/fitnesse/fixture/slim/MockXmlServerSetup ?
A "Content-type" header is required by some FitNesse Fixtures.

desirable, but does not appear to work:

!define HTML { {{{

<html lang="en">
<header>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</header>
<body>
. . .

Gzip via REST

Do you support gzip, or plan to in the future? Thnx

Screenshot of mouse-over

I wanna make a screenshot while the mouseover action is happening (for instance to confirm the button color changed)

atm a hover-to and take screenshot will not achief this

Setting global timeout

Is there a table that can set up a global timeout for an entire suite?
I see documentation of "seleniumDefaultTimeout", but I'm unclear on where to set it.

What is the format of a table defining a longer timeout, to avoid the error in a browser test table:
"Timed-out waiting (after 10s)."

I have 75 test pages, and would like to change this in one place, to iterate until the best value is found for the network and server latency.

I have tried:

|script|selenium driver setup|
|set property|slim.timeout|value|45|
|set property|seleniumDefaultTimeout|value|45|
|note - numbers with and without "seconds", but none has an effect on the default 10s timeout|

Screenshot destination dir with different FitnesseRoot (-r command line arg)

Hi,

I'm using a different FitNesseRoot (-r command line arg) and it seems screenshot mechanism is not working properly. Probably because you're using ContextConfigurator.DEFAULT_ROOT to compose screenshot destination dir.

The same goes for URL generation, didn't test that but probably won't work if a different ContextRoot is configured in plugins.properties.

By inspecting FitNesse implementation I couldn't see an easy way to achieve that (get reference for configured FITNESSE_ROOT), since WikiPage or FitnesseContext objects that could provide this information aren't accessible by custom Fixtures or SlimTables.

Browser test action for double click

Selenium supports sending double-click to the driver (Actions::doubleClick), but I did not see a way to do that with the BrowserTest fixture. Did I miss something?

Store after a get value of specified attribute inside a element

Hello,
I'm trying to check if a "like" action will increment the number show on my web page.
To do that, I was thinking to store number value before the action, and compare it to the value after the action.

I know I can get my value this way : value of | xpath=//*[@id="nb-vote"]
Is there a way to store it temporaly?

2.0.0b Allow direct Java to also wait until elements appear (just as calls via Slim do)

In the 2.0.0b release of hsac-fitnesse-fixtures the code of BrowserTest was changed to do waiting for elements to appear in a different way. This works using an aspect oriented approach, in invoke(). This does NOT work in combination with the Xebium bridge, which just does direct calls on BrowserTest methods. These direct calls do not go via invoke and therefore the calls are not wrapped in an ExpectedCondition.

It would be very good if direct calls also can get the same 'waitUntil experience' as Slim calls.

Unchecked checkbox to be default

I have a problem with browser test, everytime i run same test it keep the checkbox checked/unchecked depends on previous test. What should i do do make it always be unchecked?
(already made in browser not to save cookies and used in wiki delete cookies command but it didnt help)
thanks i advance

maven enforcer plugin DependencyConvergence check fails for cglib-nodep

[WARNING] 
Dependency convergence error for cglib:cglib-nodep:3.1 paths to dependency are:
+-com.x:y:0.2-SNAPSHOT
  +-nl.hsac:hsac-fitnesse-fixtures:2.1.1
    +-cglib:cglib-nodep:3.1
and
+-com.x:x:0.2-SNAPSHOT
  +-nl.hsac:hsac-fitnesse-fixtures:2.1.1
    +-org.seleniumhq.selenium:selenium-java:2.47.1
      +-org.seleniumhq.selenium:selenium-chrome-driver:2.47.1
        +-org.seleniumhq.selenium:selenium-remote-driver:2.47.1
          +-cglib:cglib-nodep:2.1_3

Suggested fix in pom.xml:

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.47.1</version>
            <exclusions>
            <exclusion>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-htmlunit-driver</artifactId>
            </exclusion>
+           <exclusion>
+               <groupId>cglib</groupId>
+               <artifactId>cglib-nodep</artifactId>
+           </exclusion>
            </exclusions>
        </dependency>

Timeout clicking a UI element with ios-driver

I am running this:

!define PROTOCOL {http}
!define url {${PROTOCOL}://localhost:5555/wd/hub}

!define TEST_SYSTEM {slim} 

!define slim.timeout {90}

|Import                            |
|nl.hsac.fitnesse.fixture.slim     |
|nl.hsac.fitnesse.fixture.slim.web |

|script              |selenium driver setup                                                                                                    |
|connect to driver at|${url}|with capabilities|!{device:iphone,language:en,locale:en_US,CFBundleName:!-InternationalMountains-!,simulator:true,variation:iPhone5s,instruments:true}|

|storyboard | browser test |
| click       | Mountain 1   |

But I am getting a timeout when trying to click:

Command duration or timeout: 81 milliseconds
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'Marcio-Marchinis-MacBook-Pro-Silver.local', ip: '192.168.33.109', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.3', java.version: '1.8.0_40'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{aut=/Users/mqm/Downloads/ios-driver/InternationalMountains.app, language=en, CFBundleIdentifier=com.yourcompany.InternationalMountains, locale=en_US, variation=iPhone5s, platform=UNIX, rect={size={width=320, height=568}, origin={x=0, y=0}}, elementTree=true, systemName=iPhone OS, browserVersion=1.0, platformVersion=8.3, takesScreenshot=true, browserName=InternationalMountains, javascriptEnabled=true, iosTouchScreen=true, platformName=IOS, rotatable=true, supportedLocales=[en, fr, zh], simulator=true, cssSelectors=true, version=null, CFBundleVersion=1.0, name=iPhone Simulator, locationContextEnabled=true, sdkVersion=8.3, takesElementScreenshot=false, device=iphone, iosSearchContext=true, configurable=true}]
Session ID: f69808a7-8b60-4c4b-a56c-88374e7280ec
*** Element info: {Using=css selector, value=[aria-label='Mountain 1']}.

Note that I run the iOS-driver example/server like this:

java -jar ios-server-standalone-0.6.6-SNAPSHOT.jar -aut InternationalMountains.app -port 5555

Note that I do not get this timeout problem with my own experimentation fixture https://github.com/sglebs/BetDevFitNesse/blob/master/src/main/java/net/betterdeveloper/fitnesse/RemoteWebDriverFixture.java

This works for me:

!define PROTOCOL {http}
!define url {${PROTOCOL}://localhost:5555/wd/hub}

!define TEST_SYSTEM {slim} 
!path ./dependencies/*

!define slim.timeout {90}

|import|
|net.betterdeveloper.fitnesse|

|library |
|Remote Web Driver Fixture |

| script |
| start on | ${url} | with capabilities | {"device" : "iphone", "language": "en", "locale": "en_US", "CFBundleName": "InternationalMountains", "simulator": "true", "variation":"iPhone5s", "instruments": "true"} |
| click on element with name | Mountain 1 |
| stop |

Request: extend fixture to support appium?

Not an issue, more like a feature request.

Would it be possible to extend the driver setup and helpers to make use of AndroidDriver (appium) and support MobileElements (subclass of WebElement, but with bonus-operations), so that we could create a native app test fixture that supports swiping, multi-touch and mobile element locating?

I tried extending it, but alas my experience is insufficient. (I get an AndroidDriver, but then fail, because the rest of the fixtures are expecting WebElements and not MobileElements). Using only standard webDriver commands, automating native apps already works quite nicely using your fixtures.

enter followed by click (textbox)

|storyboard|browser test                                                              |
|open      |!-https://www.telfort.nl/Algemeen/Contact/contactformulier/glasvezel.htm-!|
|click     |Ja, ik ga akkoord                                                         |
|click     |Verzenden                                                                 |
|enter     |abcefg       |as       |id=wmformfragment_personal_data_description       |
|click     |Man                                                                       |

In this specfic case you get no error, but the screenshot clearly show that Man radio button is never clicked
(either clicking man 2x or clicking before enter by passes the issue)

Improvement suggestion: Add 'wait' to "switchToNextTab" and "SwitchToPreviousTab"

As discussed with you, it might be a nice feature to add some time to wait when executing the commands "switchToNextTab" and "SwitchToPreviousTab".

Without a 'wait', the above commands could already be executed when no new instance of a tab yet exists. This causes the commands to fail. A workaround would be that the user needs to add a 'wait' command him or herself. However, this might not be clear with current instructions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.