Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.23 KB

README.md

File metadata and controls

55 lines (38 loc) · 1.23 KB

Examples

The examples are stored in this folder and are intended to demonstrate how the BiDi protocol can be used. Examples are based on Puppeteer's examples.

Installation

The examples are written using Python, in order to align with E2E tests. Python 3.10+ and some dependencies are required:

python -m pip install --user -r requirements.txt

Running

The examples require WebDriver BiDi server running on the same host on port 8080.

The server (CDP-BiDi Mapper) can be run from the project root:

npm run server

ChromeDriver and EdgeDriver can be run by:

$DRIVER_BINARY_PATH [--port=8080]

Firefox can be run by:

$FIREFOX_BINARY_PATH [--remote-debugging-port=8080]

After running the BiDi server, examples can be simply executed, for example:

<!-- keep-sorted start -->
python3 console_log_example.py
python3 print_example.py
python3 screenshot_example.py
python3 script_example.py
<!-- keep-sorted end -->

Classic-BiDi examples

CDP-BiDi Mapper does not support WebDriver classic by itself, so you need to use ChromeDriver, EdgeDriver or GeckoDriver to run the following example:

python3 classic_to_bidi_example.py