Execute a web page including running JavaScript in a headless browser using PuppeteerSharp.
Both anonymous and authenticated pages will be loaded.
The component will load an authenticated page and handle the redirect to the login page if it occurs and username and password are provided. The login page must handle deep linking to return to the requested page.
Installation
Install the Puppeteer forge component.
The Puppeteer_IS module and Puppeteer_Ext extension will be installed.
Configuration
To see trace logs in the General log, set the site property IsDebug to True in Puppeteer_IS.
Exposed Actions
The actions exposed in Puppeteer_IS are:
Puppeteer_Browse Browse to the URL
Puppeteer_BrowseAndActions Browse to a URL. Then perform the specified actions.
Puppeteer_LoginAndBrowse Browse to a URL, and if redirected to the Login page, login with the provided credentials
Puppeteer_LoginBrowseAndActions Browse to a URL, and if redirected to the Login page, login with the provided credentials. Then perform the specified actions.
Puppeteer_InstallDefaultBrowser Install the default browser. The Browse actions will install the default browser automatically.
Puppeteer Actions
The available actions are:
GOTO Navigate to a URL. The Value is the URL to navigate to, the Selector is the element to wait for after navigation.
CLICK Click on an element. The Selector is the element to click on.
CLICKGOTO Click on an element and then wait for navigation to another page. The Selector is the element to click on.
TYPE Type a value into an element. The Selector is the element to type into, the Value is the value to type.
WAIT Wait for an element to become visible. The Selector is the element to wait for.
Structures
Puppeteer_BrowseR
Url: Browse to this URL. Wait until the page is loaded and there is no further network activity.
TimeoutSeconds: Wait timeout in seconds.
WaitForSelector: Wait for the element defined by this CSS selector to appear. If empty, processing will continue after the page is loaded.
ScreenHeight: View port height in px
ScreenWidth: View port width in px
Puppeteer_LoginR Record to use for logging in
Username: Login with this username. Only used if the login page appears, which is determined by the presence of an element matching the LoginPageSelector.
Password: Login with this password. Only used if the login page appears, which is determined by the presence of an element matching the LoginPageSelector.
LoginPageSelector: CSS selector to identify the login page. Whether a page is the login page is determined by the presence of an element matching this LoginPageSelector.
LoginButtonSelector: CSS selector for the login button eg ".login-form button.btn-primary"
UsernameSelector: CSS selector for the username input eg "#Input_UsernameVal"
PasswordSelector: CSS selector for the password input eg "#Input_PasswordVal"
Puppeteer_ActionR An action to perform
Action:
GOTO Value = URL to navigate to, Selector = Wait for this element to appear after navigation.
CLICK Selector = The element to click on.
CLICKGOTO Selector = The element to click on. After click will wait for navigation.
TYPE Selector = The element to type into, Value = The value to type.
WAIT Selector = The element to wait to become visible.
Selector: CSS selector to identify the target element if required by the action.
Value: The value if required by the action.
TimeoutSeconds: Wait timeout in seconds. If -1, the browse timeout is used.