var support_ui = JavaImporter(org.openqa.selenium.support.ui.WebDriverWait)
var conditions = org.openqa.selenium.support.ui.ExpectedConditions
var exception = null
try
{
//wait for the I agree field to be visible
wait.until(pkg.ExpectedConditions.presenceOfElementLocated(pkg.By.xpath('//CHECKBOX[@id="agree-check"]')))
}
catch (err)
{
WDS.log.error(err.message)
var screenshot = WDS.browser.getScreenshotAs(selenium.OutputType.FILE)
screenshot.renameTo(io.File('C:\PONG-PT\screenshot.png'))
fileUtils.FileUtils.copy(screenshot, new io.File('C:\\PONG-PT\\screenshot.png'))
exception = err
}
but doesnt work , get an error ‘TypeError: null has no such function "copy" in <eval> at line number 97’