I have been using JMeter for quite some time, but webdriver is new to me. I am trying to do some timings for a multi-page script and ask a question. I am using JMeter webdriver sampler and HTMLunit:
Here is the scenario
1. Go to the web page http://162.243.100.234
2. Enter the word hello in the search field
3. Click Submit
What I want to get:
1. How long did it take to load the first page
2. How long did it take when I clicked the submit button when the results page was loaded.
I have the following code that gives me only one timing. How do I change it so that I have two?
var pkg = JavaImporter(org.openqa.selenium)
var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var wait = new support_ui.WebDriverWait(WDS.browser, 5000)
WDS.sampleResult.sampleStart()
WDS.browser.get('http://162.243.100.234/')
var searchField = WDS.browser.findElement(pkg.By.id('s'))
searchField.click()
searchField.sendKeys(['hello'])
var button = WDS.browser.findElement(pkg.By.id('searchsubmit'))
button.click()
WDS.sampleResult.sampleEnd()
Start sampleEnd, .
- ?