Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created December 7, 2018 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seleniumgists/ed9a27c2a9c8b79d7a4f1bc6ef582d9f to your computer and use it in GitHub Desktop.
Save seleniumgists/ed9a27c2a9c8b79d7a4f1bc6ef582d9f to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
await console.log("smaaash.......");
const scriptToGetAlertText = `const result = document.evaluate(
\"//div[@id='titleError']/text()[normalize-space()]\",
document,
null,
XPathResult.STRING_TYPE,
null
);
return result.stringValue;`;
let resultText: string;
console.log(1);
try {
resultText = await this.driver.executeScript<string>(scriptToGetAlertText);
} catch (error) {
resultText = resultText;
}
await console.log(". . . . .");
console.log(resultText);
return resultText.trim();
```
I'm getting:
```
StaleElementReferenceError: stale element reference: element is not attached to the page document
```
But my Logs are showing:
```
smaaash.......
1
1) should return the appropriate error for the Location field.<https://gitlab.com/issuetrak/issuetrak/issues/2557>
spec.js:72
. . . . .
Location not found. Please use the search button to locate the Location record.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment