Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Browser/entry/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,13 @@ def launch_browser_server(browser, options):
to the keyword `Launch Browser Server`. Arguments must be in the form of `argument_name=value`.
See the keyword documentation for more details on the available options.

Values are converted by Robot Framework, so quote the whole `argument_name=value` pair when
it contains spaces or quotes. Otherwise the shell strips them and the conversion fails.

\b
Example:
rfbrowser launch-browser-server chromium "timeout=10 sec" "proxy={'server': 'http://localhost:8888'}"

== Connecting to a randomly generated websocket ==

When the browser server is started, the generated wsEndpoint is printed to the console.
Expand Down
4 changes: 2 additions & 2 deletions Browser/keywords/playwright_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1701,8 +1701,8 @@ def save_storage_state(self) -> str:
| `New context`
| `New Page` https://login.page.html
| # Perform login
| VAR ${username} %{USERNAME} # Convert environment variable to secret
| VAR ${password} %{PASSWORD} # Convert environment variable to secret
| VAR ${username: Secret} %{USERNAME} # Convert environment variable to secret
| VAR ${password: Secret} %{PASSWORD} # Convert environment variable to secret
| `Fill Secret` id=username ${username}
| `Fill Secret` id=password ${password}
| `Click` id=button
Expand Down
32 changes: 32 additions & 0 deletions atest/test/01_Browser_Management/playwright_state.robot
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ Launch Browser Server Via CLI
... headless\=${HEADLESS}
... port\=8273
... wsPath\=server3
... timeout\=30s
... slowMo\=0s
Wait Until Keyword Succeeds
... 10s
... 1s
Expand All @@ -482,6 +484,36 @@ Launch Browser Server Via CLI
Get Viewport Size height == 100
[Teardown] Terminate All Processes

Launch Browser Server Via CLI With Proxy
[Documentation] The `proxy` TypedDict is converted twice: once by the CLI and once when
... the entry point calls the keyword by attribute access. Nothing listens on port 1, so
... a refused proxy connection is what proves the option survived both conversions and
... reached the browser. A proxy that was accepted but ignored would let the page load
... and this test would prove nothing.
[Tags] no-docker-pr
${python} = Get Python Binary Path
${process} = Start Process
... ${python}
... -m
... Browser.entry
... launch-browser-server
... chromium
... headless\=${HEADLESS}
... port\=8274
... wsPath\=server4
... timeout\=30s
... proxy\={'server': 'http://localhost:1'}
Wait Until Keyword Succeeds
... 10s
... 1s
... Connect To Browser
... wsEndpoint=ws://localhost:8274/server4
... browser=chromium
Run Keyword And Expect Error
... *net::ERR_PROXY_CONNECTION_FAILED*
... New Page ${LOGIN_URL}
[Teardown] Run Keywords Close Browser ALL AND Terminate All Processes

Connect To Browser With Timeout
TRY
Connect To Browser wsEndpoint=ws://10.66.66.66:8277/server2 timeout=100ms
Expand Down