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
2 changes: 1 addition & 1 deletion docs/commands/browser/url.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ console.log(await browser.getUrl()); // outputs: "https://webdriver.io"
**baseUrlResolutions.js**

```javascript
// Let baseUrl = http://example.com/site
// Let baseUrl = http://example.com/site/ important to add a slash in the end

// Specifying a full URL results in https://webdriver.io
await browser.url("https://webdriver.io");
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/config/browsers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Base URL of the service being tested. Allows for more convenient use of the `bro

- if the target address starts with `/`, `baseUrl` without the path part will be added at the beginning.
- if the target address does not start with `/`, the entire `baseUrl` will be added at the beginning.
- it is important whether `/` exists (or not). [See more][url-resolve].

Default: `http://localhost`.

Expand Down Expand Up @@ -1195,3 +1196,4 @@ export = {
[saveState]: ../../../commands/browser/saveState
[restoreState]: ../../../commands/browser/restoreState
[getState]: ../../../commands/browser/getState
[url-resolve]: https://nodejs.org/api/url.html#urlresolvefrom-to
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ console.log(await browser.getUrl()); // выведет: "https://webdriver.io"
**baseUrlResolutions.js**

```javascript
// Пусть baseUrl = http://example.com/site
// Пусть baseUrl = http://example.com/site/ важно указывать слэш в конце

// При указании полного URL-адреса итоговый URL будет https://webdriver.io
await browser.url("https://webdriver.io");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ URL грида (адрес, на котором слушает ChromeDriver/Sele

- если целевой адрес начинается с `/`, в начало будет добавлен `baseUrl` без path-части.
- если целевой адрес не начинается с `/`, в начало будет добавлен весь `baseUrl`.
- важно наличие или отсутствие `/` в конце. [Подробнее][url-resolve].

По умолчанию: `http://localhost`.

Expand Down