webdriverio
Version:
Next-gen browser and mobile automation test framework for Node.js
22 lines (21 loc) • 950 B
TypeScript
/**
* Get the URL of the document shown in this browsing context, read from the
* page. It also updates the `url` property, which otherwise holds the URL the
* context was last navigated to and does not follow navigations the page did itself.
*
* <example>
:getUrl.js
it('reads the url after the page changed it', async () => {
const page = await browser.url('https://webdriver.io')
await page.execute(() => history.pushState({}, '', '/docs/api'))
console.log(page.url) // outputs: "https://webdriver.io", the url it was navigated to
console.log(await page.getUrl()) // outputs: "https://webdriver.io/docs/api"
console.log(page.url) // outputs: "https://webdriver.io/docs/api"
})
* </example>
*
* @alias browsingContext.getUrl
* @return {string} the document URL
*/
export declare function getUrl(this: WebdriverIO.BrowsingContext): Promise<string>;
//# sourceMappingURL=getUrl.d.ts.map