Skip to main content

PDF capture

I capture the PDF text from the current URL

Captures the text in a PDF document from the current URL in the browser and binds it to the PDF text variable in the global scope.

Example

  Given the pdf url is "https://example.com/file.pdf"
When I navigate to "${the pdf url}"
And I capture the PDF text from the current URL
Then the PDF text should contain "Some expected text"
I capture the PDF text from the current URL as <name>

Captures the text in a PDF document from the current URL in the browser and binds it to the given name in the global scope.

Where

  • <name> is the name in the global scope to bind the captured PDF text to

Example

  Given the pdf url is "https://example.com/file.pdf"
When I navigate to "${the pdf url}"
And I capture the PDF text from the current URL as content
Then content should contain "Some expected text"
I capture the PDF text from url "<url>"

Captures the text in a PDF document from a given URL location and binds it to the PDF text variable in the global scope.

Where

  • <url> is the web URL of the PDF document to capture the text of

Example

   When I capture the PDF text from url "https://example.com/file.pdf"
Then the PDF text should contain "Some expected text"
I capture the PDF text from url "<url>" as <name>

Captures the text in a PDF document from a given URL location and binds it to the given name in the global scope.

Where

  • <url> is the web URL of the PDF document to capture the text of
  • <name> is the name in the global scope to bind the captured PDF text to

Example

   When I capture the PDF text from url "https://example.com/file.pdf" as content
Then content should contain "Some expected text"
I capture the PDF text from file "<filepath>"

Captures the text in a PDF document from a local file and binds it to the PDF text variable in the global scope.

Where

  • <filepath> the path to the local PDF document file to capture the text of

Example

   When I capture the PDF text from file "/path/to/file.pdf"
Then the PDF text should contain "Some expected text"
I capture the PDF text from file "<filepath>" as <name>

Captures the text in a PDF document from a local file and binds it to the given name in the global scope.

Where

  • <filepath> the path to the local PDF document file to capture the text of
  • <name> is the name in the global scope to bind the captured PDF text to

Example

   When I capture the PDF text from file "/path/to/file.pdf" as content
Then content should contain "Some expected text"
I capture the base64 encoded PDF text from <blobRef>

Captures the text in a PDF document from a base64 encoded BLOB and binds it to the PDF text variable in the global scope.

Where

  • <blobRef> is the name of the binding containing the base64 encoded PDF

Example

  Given the pdf blob is "Some base64 encoded PDF blob"
When I capture the base64 encoded PDF text from the pdf blob
Then the PDF text should contain "Some expected text"
I capture the base64 encoded PDF text from <blobRef> as <name>

Captures the text in a PDF document from a base64 encoded BLOB and binds it to the given name in the global scope.

Where

  • <blobRef> is the name of the binding containing the base64 encoded PDF
  • <name> is the name in the global scope to bind the captured PDF text to

Example

  Given the pdf blob is "Some base64 encoded PDF blob"
When I capture the base64 encoded PDF text from the pdf blob as content
Then content should contain "Some expected text"