Skip to content

Error: browser.newContext: Error: Unknown scheme for Initializer: Selectors. #43

@phproberto-bluebox

Description

@phproberto-bluebox

I've an authenticated API and with playwright I've a function like this:

    const newBrowserPageFromApi = async ({ browser, api }: { browser: Browser, api: APIRequestContext }): Promise<Page> => {
        const storageState = await api.storageState();
        const apiContext = await browser.newContext({ storageState });
        return await apiContext.newPage();
    };

That creates a new page authenticated using the already authenticated API for browsing purposes and saves me to use the logic to enter the login + password. It works perfectly when used directly in playwright but fails when using it through browserstack. The error is:

1) [chrome-latest:Windows 11-browserstack] › extensions/wow_ecommerce/tests/admin/config/wow_ecommerce_config.spec.ts:18:7 › WowEcommerce Admin > Config > Wow Ecommerce › Config can be saved

    Error: browser.newContext: Error: Unknown scheme for Initializer: Selectors.

       at ../composables/api/useWowApiTools.ts:7

       5 |         const storageState = await api.storageState();
       6 |         console.log('storageState', storageState);
    >  7 |         const apiContext = await browser.newContext({ storageState });
         |                            ^
       8 |         return await apiContext.newPage();
       9 |     };
      10 |

I couldn't find anything in playwright related to this and it works directly in playwright so I think this is specific to the browserstack integration. Information:

platforms:
  - os: Windows
    osVersion: 11
    browserName: chrome
    browserVersion: latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions