Search code examples
selenium-webdriveride

How can I store the resulting text on a website print into a text document?


I have a site which is not yet public, so you won't be able to open the site, but a screenshot is enclosed below.

I open the site in Selenium IDE. Then I click the button Skip To Summary in Selenium IDE. This works fine.

My question is how (or If) I cat get the resulting text, shown in the right grey part of the screen into a textfile. Kind of screen scraping. If I could get to the html behind the screen it would also help me, but preferably the readable text as shown at the screen.

enter image description here

Thanks in advance,

Saskia Hermans


Solution

  • You can use the store text command. You would need to provide the locator for the element that you want to grab the text from.

    See store text in the docs.

    You could also just use assert text if you know what the expected text is supposed to be.

    See assert text in the docs.