WebDriver Sampler : How can we take logs of perticular webdriver sampler

395 views
Skip to first unread message

akshay.p...@globallogic.com

unread,
Mar 18, 2015, 7:54:50 AM3/18/15
to jmeter-...@googlegroups.com
Hi All,
I am facing challenge to take logs for webdriver sampler.
I want to take logs of webdriver sampler while executing and store it in file,is there any way to perform this??

Thanks,
Akshay

gli...@gmail.com

unread,
Mar 19, 2015, 3:54:53 AM3/19/15
to jmeter-...@googlegroups.com, akshay.p...@globallogic.com
Isn't WDS.log function what you're looking for? As per WebDriver Sampler Documentation

  1. WDS.log - is a Logger instance to allow the scripter to debug their scripts by writing information to the jmeter log file (JMeter provides a GUI for its log entries)
Example usage:

WDS.log.info('Opening example.com page')
WDS
.browser.get('http://example.com')
if (WDS.browser.getTitle()!='Example Domain'){
    WDS
.log.error('Page title mismatch');
}
else {
   WDS
.log.info('Page example.com opened successfully')
}

It'll result in the following entries in jmeter.log file

2015/03/19 10:52:38 INFO  - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: Opening example.com page 
2015/03/19 10:52:38 INFO  - com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler: Page example.com opened successfully 

If you're not totally happy with appending information to JMeter's log file and would rather like a separate file being created, take a look into The WebDriver Sampler: Your Top 10 Questions Answered guide to learn how to call Java classes methods from within the WebDriver Sampler

Akshay Pachkhede

unread,
Mar 19, 2015, 7:21:08 AM3/19/15
to jmeter-...@googlegroups.com, akshay.p...@globallogic.com, gli...@gmail.com
Hi gli...@gmail.com

This is really helpful.
Logs obtained in Jmeter.log file are helpful.
Thanks for your Input.

Reply all
Reply to author
Forward
0 new messages