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)
**var support_page=JavaImporter(org.openqa.selenium.WebDriver.Timeouts)**
**var support_p=new support_page.pageLoadTimeout(30, TimeUnit.SECONDS)**
var url = WDS.args[0];
var user = WDS.args[1];
var pwd = WDS.args[2];
WDS.sampleResult.sampleStart()
WDS.browser.get(url)
var wait=new support_ui.WebDriverWait(WDS.browser,15000)
var userName = WDS.browser.findElement(pkg.By.id('Login_txtUserName')).sendKeys([user])
//userName.click()
//userName.sendKeys(['pandian'])
var userPwd = WDS.browser.findElement(pkg.By.id('Login_txtPassword')).sendKeys([pwd])
//userPwd.click()
//userPwd.sendKeys(['1234'])
var button = WDS.browser.findElement(pkg.By.id('Login_btnLogin')).click()
//button.click()
Even though I managed to import the WebDriver.Timeouts
class successfully, I encountered an issue trying to access the Method pageLoadTimeout
. When running JMeter, it kept showing the error message:
Response message: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "TimeUnit" is not defined. (#5) in at line number 5
I am seeking assistance to resolve this problem and enable JMeter to access the pageLoadTimeout()
method properly.