Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Created February 11, 2021 20:57
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 eliasnogueira/ac9e3e281f05c7158daeaa6b5be88b74 to your computer and use it in GitHub Desktop.
Save eliasnogueira/ac9e3e281f05c7158daeaa6b5be88b74 to your computer and use it in GitHub Desktop.
Reads the image src attribute and decode it using Zxing
@Test
void readQRCodeFromURL() {
String qrCodeFile = driver.findElement(By.id("qr")).getAttribute("src");
// get the qr code content and assert the result
String qrCodeResult = decodeQRCode(qrCodeFile);
assertThat(qrCodeResult).isEqualTo("c72a0de5-eba3-4bf0-bde2-fc709e71df29");
}
@eliasnogueira
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment