It's working now.
(https://github.com/roydekleijn/Spring-Jbehave-WebDriver-Example)
One disadvantage is that I can't use PageFactory.initElements .
When using this you have to define the webelements only once, with this code:
@FindBy(how = How.CSS, using = "input[name='q']")
private WebElement searchField;
And then you can reuse searchField where needed.
Would be great if this is supported as well. Anybody know how ?
cheers,
Roy de Kleijn
From: Roy de Kleijn [mailto:[email protected]]
Sent: maandag 3 december 2012 11:16
To: [email protected]
Subject: RE: [jbehave-user] Re: Can't run in threads
Thanks Graham,
But I think it should be possible with the JUnitStories as well. I hope Mauro
or Alexander still do have some ideas.
Roy
________________________________
Van: Graham Abell [[email protected]]
Verzonden: maandag 3 december 2012 10:47
Aan: [email protected]<mailto:[email protected]>
Onderwerp: Re: [jbehave-user] Re: Can't run in threads
Hi Roy,
Have a look here - it's somewhat simplified than what we're doing but you
should get the idea...
https://gist.github.com/4193926
Graham
On 3 December 2012 09:35, Roy de Kleijn
<[email protected]<mailto:[email protected]>> wrote:
Thanks for your answer!
>From which class do you extend for it ?
I assume that this is wrong, if you look at this code:
https://github.com/roydekleijn/Spring-Jbehave-WebDriver-Example/blob/master/src/main/java/org/google/web/common/SeleniumWebDriverProvider.java
Can you suggest what I should implement where?
Many thanks,
Roy
________________________________
Van: Graham Abell [[email protected]<mailto:[email protected]>]
Verzonden: maandag 3 december 2012 10:30
Aan: [email protected]<mailto:[email protected]>
Onderwerp: Re: [jbehave-user] Re: Can't run in threads
Hi Roy,
We have our own Grid and we run JBehave tests in parallel on it.
We don't using the built in concurrency of JBehave but instead manage that
ourselves in app which listens for new tests to run, however I think our
approach will work in your situation to. We extended the StoryRunner class and
instantiate a ThreadLocal wrapper for WebDriver in there - this means we get a
new WebDriver instance inside the thread where the actual scenario is run.
Because the driver is stored in a threadlocal object it means all DSL calls
inside that thread access the correct driver instance.
Hope this helps.
cheers,
Graham
On 3 December 2012 09:21, Roy de Kleijn
<[email protected]<mailto:[email protected]>> wrote:
Thanks for your quick answer, but I'm quite disappointed now. I tell you why:
We (our company) are running our own grid. So we like to execute testscripts in
parallel against that grid.
I hope there is another solution, as there are also more vendors like SauceLabs,
Roy
________________________________________
Van: Mauro Talevi
[[email protected]<mailto:[email protected]>]
Verzonden: maandag 3 december 2012 9:22
Aan: [email protected]<mailto:[email protected]>
Onderwerp: Re: [jbehave-user] Re: Can't run in threads
Hi Roy,
multi-threading with Selenium is supported via the SauceWebDriverProvider.
You can open a free account on SauceLabs, for limited testing.
Cheers
On 03/12/2012 01:36, Roy de Kleijn wrote:
> It almost works! Thanks to Alexander Lehmann, he helped me to sort this out!
> Number of threads are set in the POM file.
>
> But it seems like that all the webdriver commands are send to the last
> defined thread. This results in a lot errors.
> Please take a look at:
> https://github.com/roydekleijn/Spring-Jbehave-WebDriver-Example/blob/master/src/main/java/org/google/web/common/SeleniumWebDriverProvider.java
>
> Here we tried to introduce some thread safety.
>
> I hope somebody can help on this. It works, when I run my tests on one thread.
>
>
> Thanks in advance,
> Roy
>
> -----Original Message-----
> From: Alexander Lehmann [mailto:[email protected]<mailto:[email protected]>]
> Sent: zondag 2 december 2012 18:13
> To: [email protected]<mailto:[email protected]>
> Subject: [jbehave-user] Re: Can't run in threads
>
> Looks like the project doesn't compile with java 6 (works with java 7)
>
>
>
> On 02.12.2012 14<tel:02.12.2012%2014>:38, Mauro Talevi wrote:
>> Hi Roy,
>>
>> your project does not compile:
>>
>> Failed to execute goal
>> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
>> (default-compile) on project Spring-Jbehave-WebDriver-Example:
>> Compilation failure
>> [ERROR]
>> /Users/mauro/git/Spring-Jbehave-WebDriver-Example/src/main/java/org/go
>> ogle/web/test/SearchResultsPage.java:[48,2]
>> cannot find symbol
>> [ERROR] symbol : method
>> assertThat(java.util.List<java.lang.String>,org.hamcrest.Matcher<java.lang.Iterable<?
>> super java.lang.Object>>)
>> [ERROR] location: class org.google.web.test.SearchResultsPage
>>
>> $ mvn -v
>> Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100) Maven home:
>> /Users/mauro/applications/mvn Java version: 1.6.0_37, vendor: Apple
>> Inc.
>> Java home:
>> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
>> Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x",
>> version: "10.8.2", arch: "x86_64", family: "mac"
>>
>> You do not specify what is the problem that you're facing.
>>
>> I did notice that you have only one thread configured though.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email