Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
how do I take a screenshot when doing parallel test with web driver ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Apha  
View profile  
 More options Nov 7 2012, 5:45 pm
From: Apha <amogh.ga...@gmail.com>
Date: Wed, 7 Nov 2012 14:45:27 -0800 (PST)
Local: Wed, Nov 7 2012 5:45 pm
Subject: 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,

 String browser, String appHost, String dbDriver,

 String url, String userName, String password, String busDbUrl, String
busUserName,

 String busPassword)

 throws Exception {

 DesiredCapabilities desiredCapabilities = null;

 if (browser.equalsIgnoreCase("*firefox")) {

 desiredCapabilities = DesiredCapabilities.firefox();

 }

 else if (browser.equalsIgnoreCase("*chrome")) {

 desiredCapabilities = DesiredCapabilities.chrome();

 }

 else if (browser.equalsIgnoreCase("*iexplore")) {

 desiredCapabilities = DesiredCapabilities.internetExplorer();

 }

  stdout.print("http://" + seleniumHostAddress + ":" + seleniumPort + "/srm"
);

 webDriver = new RemoteWebDriver(new URL("http://" + seleniumHostAddress +
":" + seleniumPort + "/wd/hub"), desiredCapabilities);

 webDriver.get(appHost);

 webDriver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);

}
}

Thanks

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Krishnan Mahadevan  
View profile  
 More options Nov 12 2012, 6:12 am
From: Krishnan Mahadevan <krishnan.mahadevan1...@gmail.com>
Date: Mon, 12 Nov 2012 16:42:42 +0530
Local: Mon, Nov 12 2012 6:12 am
Subject: Re: [webdriver] how do I take a screenshot when doing parallel test with web driver ?

This should help you out :
http://darrellgrainger.blogspot.ca/2011/02/generating-screen-capture-...
http://darrellgrainger.blogspot.in/2012/07/creating-screen-capture-on...

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening
or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
darrell  
View profile  
 More options Nov 12 2012, 9:44 am
From: darrell <darrell.grain...@gmail.com>
Date: Mon, 12 Nov 2012 06:44:26 -0800 (PST)
Local: Mon, Nov 12 2012 9:44 am
Subject: Re: how do I take a screenshot when doing parallel test with web driver ?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Apha  
View profile  
 More options Nov 12 2012, 11:04 am
From: Apha <amogh.ga...@gmail.com>
Date: Mon, 12 Nov 2012 08:04:38 -0800 (PST)
Local: Mon, Nov 12 2012 11:04 am
Subject: Re: how do I take a screenshot when doing parallel test with web driver ?

Thanks I implemented using ThreadLocal so that I have seperate instances of
webdriver and take a screenshot


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Collin  
View profile  
 More options Nov 13 2012, 6:29 pm
From: "Mark Collin" <mark.col...@lazeryattack.com>
Date: Tue, 13 Nov 2012 23:29:13 -0000
Local: Tues, Nov 13 2012 6:29 pm
Subject: RE: [webdriver] how do I take a screenshot when doing parallel test with web driver ?

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:

https://github.com/Ardesco/Selenium-Maven-Template

enjoy J

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,

String browser, String appHost, String dbDriver,

String url, String userName, String password, String busDbUrl, String
busUserName,

String busPassword)

throws Exception {

DesiredCapabilities desiredCapabilities = null;

if (browser.equalsIgnoreCase("*firefox")) {

desiredCapabilities = DesiredCapabilities.firefox();

}

else if (browser.equalsIgnoreCase("*chrome")) {

desiredCapabilities = DesiredCapabilities.chrome();

}

else if (browser.equalsIgnoreCase("*iexplore")) {

desiredCapabilities = DesiredCapabilities.internetExplorer();

}

stdout.print("http://" + seleniumHostAddress + ":" + seleniumPort + "/srm");

webDriver = new RemoteWebDriver(new URL("http://" + seleniumHostAddress +
":" + seleniumPort + "/wd/hub"), desiredCapabilities);

webDriver.get(appHost);

webDriver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);

}
}

Thanks

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »