Working with Puppeteer library

Hi,

I am evaluating Puppeteer library to replace Selenium, the porting was quite straight forward until I started to test Checkbox.
I need to get the checkbox’s state, and in Selenium it was quite simple:

${IsChecked}= Selenium2Library.Get Element Attribute ${Xpath} aria-checked
The attribute returns as it seen the the page true/false

While same request is Puppeteer returns None
${IsChecked}= PuppeteerLibrary.Get Element Attribute ${Xpath} aria-checked

The documentation for PuppeteerLibrary is quite poor, and I cannot find enough users posting on this library.

Thanks.

Never heard about PuppeteerLibrary.
Is is new? (maybe the reason for few users?)
Is is old? (maybe the reason for being abandoned?)

Why you are still using Selenium2Library? That is old.
Maybe that is the reason you are changing to another library.

I’d never heard of this library either, found it with a quick search:

Puppeteer is based on Node JS, just like Browser Library, and the Puppeteer Library uses playwright for Firefox and Webkit support as Puppeteer only supports chrome.

From a quick look over the site I can’t see how this provides any benefits over Browser Library?

From the documentation it looks like you have the syntax correct

There are some example script’s that they have provided: https://github.com/qahive/robotframework-puppeteer/tree/master/Examples, element-properties.robot looks to be the closest to what you are after.

In your HTML does the aria-checked attribute have a value or is it like the checked attribute on a standard html form <input> where it’s the when checked and removed when unchecked? If there is no value this might be where you are encountering the issue?

Perhaps contact the qahive team and ask them to join this forum?

Sorry I couldn’t be much help,

Dave.

@Guto You can beter use Browser Library which is based on Playwright, instead of the Puppeteer library. Playwright was developed by the same people that created its predecessor, Puppeteer. Playwright is built and maintained by Microsoft.

2 Likes

Thanks @falcon030 , I ill try it, its early enough for me to rebase my project

Thanks @HelioGuilherme66
We use Puppeteer in some JS projects, so when a Robot library exist I tried it.

2 Likes

Thanks @damies13, this really help, the Github sites are familiar and quite limited, I am going to try Browser library

2 Likes