Created
January 2, 2023 07:28
-
-
Save pragmatictesters/6f7ecb7fc6a496deaf563e0dcc7d7050 to your computer and use it in GitHub Desktop.
JMeter Example : WebDriver Sampler - Saving a record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pkg = JavaImporter(org.openqa.selenium) | |
var time = JavaImporter(java.time) | |
var support_ui = JavaImporter(org.openqa.selenium.support.ui); | |
var wait = new support_ui.WebDriverWait(WDS.browser, time.Duration.ofSeconds(30)); | |
WDS.sampleResult.sampleStart(); | |
WDS.browser.findElement(pkg.By.cssSelector('#IncidentObject_Save')).click() | |
waitUntilLoadingIsCompleted(); | |
WDS.sampleResult.sampleEnd(); | |
function waitUntilLoadingIsCompleted() { | |
wait.until(support_ui.ExpectedConditions.presenceOfElementLocated(pkg.By.cssSelector(".k-loading-text"))); | |
wait.until(support_ui.ExpectedConditions.invisibilityOfElementLocated(pkg.By.cssSelector(".k-loading-text"))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment