How do i take a screenshot of parallel running web drivers tests ? I can't define webdriver as static when I'm running parallel. Every test will have it's own instance how will I know which test failed? any suggestions
my code goes like this
public class WebDriverTest {
public WebDriver webDriver;
public void setUpProperties(String seleniumHostAddress, int seleniumPort,
"All the desirable things in life are either illegal, expensive, fattening
or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
On Thu, Nov 8, 2012 at 4:15 AM, Apha <amogh.ga...@gmail.com> wrote:
> How do i take a screenshot of parallel running web drivers tests ? I can't
> define webdriver as static when I'm running parallel. Every test will have
> it's own instance how will I know which test failed? any suggestions
> my code goes like this
> public class WebDriverTest {
> public WebDriver webDriver;
> public void setUpProperties(String seleniumHostAddress, int seleniumPort,
> --
> You received this message because you are subscribed to the Google Groups
> "webdriver" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/webdriver/-/CbNZfkuPXa0J.
> To post to this group, send email to webdriver@googlegroups.com.
> To unsubscribe from this group, send email to
> webdriver+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/webdriver?hl=en.
After you look at the post Krishnan has suggested you will see it shows you have to create ONE WebDriver which has an event listener. If you want to create multiple WebDrivers then you need to create multiple EventFiringWebDrivers. If you have a loop which creates multiple WebDriver instances then change it to a loop which creates multiple EventFiringWebDriver instances PLUS have a static counter. After each new EventFiringWebDriver, increment the counter. From within the WebDriverEventListener, store the current counter. This way you end up with each event listener having a different counter. You can then use the counter variable as part of the snapshot name. So if the snapshot is name "foo-inst1.jpg" you know that WebDriver number one caused the snapshot.
On Wednesday, 7 November 2012 17:45:27 UTC-5, Apha wrote:
> How do i take a screenshot of parallel running web drivers tests ? I can't > define webdriver as static when I'm running parallel. Every test will have > it's own instance how will I know which test failed? any suggestions
> my code goes like this
> public class WebDriverTest {
> public WebDriver webDriver;
> public void setUpProperties(String seleniumHostAddress, int seleniumPort,
On Monday, November 12, 2012 8:44:26 AM UTC-6, darrell wrote:
> After you look at the post Krishnan has suggested you will see it shows > you have to create ONE WebDriver which has an event listener. If you want > to create multiple WebDrivers then you need to create multiple > EventFiringWebDrivers. If you have a loop which creates multiple WebDriver > instances then change it to a loop which creates multiple > EventFiringWebDriver instances PLUS have a static counter. After each new > EventFiringWebDriver, increment the counter. From within the > WebDriverEventListener, store the current counter. This way you end up with > each event listener having a different counter. You can then use the > counter variable as part of the snapshot name. So if the snapshot is name > "foo-inst1.jpg" you know that WebDriver number one caused the snapshot.
> Darrell
> On Wednesday, 7 November 2012 17:45:27 UTC-5, Apha wrote:
>> How do i take a screenshot of parallel running web drivers tests ? I >> can't define webdriver as static when I'm running parallel. Every test will >> have it's own instance how will I know which test failed? any suggestions
>> my code goes like this
>> public class WebDriverTest {
>> public WebDriver webDriver;
>> public void setUpProperties(String seleniumHostAddress, int seleniumPort,
I updated my Selenium maven template today to use TestNG (as it seems to be
what all the cool kids are using) and added in a screenshot listener that
will take a screenshot if the test fails.
It's also on its way to being configured to use multiple threading at method
level:
From: webdriver@googlegroups.com [mailto:webdriver@googlegroups.com] On
Behalf Of Apha
Sent: 07 November 2012 22:45
To: webdriver@googlegroups.com
Subject: [webdriver] how do I take a screenshot when doing parallel test
with web driver ?
How do i take a screenshot of parallel running web drivers tests ? I can't
define webdriver as static when I'm running parallel. Every test will have
it's own instance how will I know which test failed? any suggestions
my code goes like this
public class WebDriverTest {
public WebDriver webDriver;
public void setUpProperties(String seleniumHostAddress, int seleniumPort,
-- You received this message because you are subscribed to the Google Groups
"webdriver" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/webdriver/-/CbNZfkuPXa0J.
To post to this group, send email to webdriver@googlegroups.com.
To unsubscribe from this group, send email to
webdriver+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/webdriver?hl=en.