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 96.0 4.34 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 Issues

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

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|

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 |

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.

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!

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.

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

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.

Testing electron app

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

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.

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)

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.

Gzip via REST

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

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!

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>
. . .

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 |

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?

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

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

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.

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."

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.

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

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>

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>

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.

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

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

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

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?

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.

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!

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.

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?

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?

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);
        }
    }

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>

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

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.