Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriver Error: no such frame #548

Closed
nair-sumesh opened this issue Sep 26, 2023 · 10 comments
Closed

WebDriver Error: no such frame #548

nair-sumesh opened this issue Sep 26, 2023 · 10 comments

Comments

@nair-sumesh
Copy link
Contributor

Describe the bug
When using Test Library via WDI5, on execution of browser.fe.initialize throws below error.
I have recently upgrade wdio-ui5-service from 1.3.2 to 2.0.0

[0-0] 2023-09-26T00:00:02.941Z ERROR webdriver: Request failed with status 200 due to WebDriver Error: no such frame
[0-0]   (Session info: chrome=117.0.5938.92)
[0-0]   (Driver info: chromedriver=117.0.5938.92 (67649b10b92bb182fba357831ef7dd6a1baa5648-refs/branch-heads/5938_62@{#14}),platform=Mac OS X 13.5.2 arm64)
[0-0] Error in "0: Then I see the "Preview" button on the "main" page as "disabled""
image

Expected behavior
Should be able to execute the Test Library code.

Runtime Env (please complete the following information):

  • wdi5/wdio-ui5-service-version: 2.0.0
  • UI5 version: [1.117.0]
  • wdio-version (output of wdio --version): 8.16.12
  • node-version (output of node --version): v18.16.1
  • OS:macOS 13.5.2
  • Browser + Version : Chrome version 117.0.5938.92
@nair-sumesh
Copy link
Contributor Author

nair-sumesh commented Sep 28, 2023

HI @vobu ,

I tried executing the test from WDI5 on main branch and also by checking out the commit chore(release): 2.0.0(b3b4db3). In both the case the test on FE passed successfully.
The UI5 version is also same in both, the WDI5 sample app as well as in my app.
I don't know how to replicate the issue for your reference.

Below is the error I am getting.
image
The snapshot is for a Jenkins job but the issue also occurs when I execute the test locally

ℹ This is a showstopper as none of the test are working now.
If you could please help me with what and where should I debug to find the root cause, it will be really helpful.

Just FYI, the test were working since many months before I upgraded to WDI5 2.0.

Regards,
Sumesh Nair

@vobu
Copy link
Contributor

vobu commented Sep 28, 2023

hi @nair-sumesh, couple of ideas:

the functional changes in wdi5's FE integration are here:

const iframe: Element = await browserInstance.findElement("css selector", "iframe")

eventually you can spot something there that helps you resolve your issue.

hth, v.

@nair-sumesh
Copy link
Contributor Author

nair-sumesh commented Sep 28, 2023

Thanks @vobu for the prompt response.

  • I tried with await wdi5.toWorkZoneShell();
  • Second time with await wdi5.toWorkZoneApp();
  • In my conf I dont pass wdi5.baseUrl as it is done dynamically. However, to test your suggestion, I also hardcoded the baseUrl to the app's address.

Still I see the error.

When I try to debug the below code from WDI5

            await browserInstance.switchToFrame(0);

it goes into infinite LoCs and I feel a bit lost.

Any other suggestions?

Regards,
Sumesh Nair

@vobu
Copy link
Contributor

vobu commented Sep 28, 2023

this seems to be an issue with the iframe(s) your app runs in (or not).
yet w/o having access to the app, things remain guesswork.
any chance you might be able to book an hour of commercial support (https://github.com/ui5-community/wdi5/blob/main/SUPPORT.md) so we can get to the root cause properly?

@nair-sumesh
Copy link
Contributor Author

Hi @vobu
When I analyzed the app with browser Inspector , i couldn't find any iframe element.
Could it be that this is workzone specific requirement.
My app is in Launchpad and may be this iframe logic does not applies there.

How can we validate this.

Regards,
Sumesh Nair

@nair-sumesh
Copy link
Contributor Author

HI @vobu ,

My analysis was correct.
The iframe does not apply for Launchpad apps.

When i commented out the code as below

        // first magic wand wave -> app context
        await loadFELibraries(browserInstance);
        await initOPA(appConfig, browserInstance);
        // second magic wand wave -> shell context
        // yet only wave the wand when there's an iframe somewhere,
        // indicating BTP WorkZone territory
       
        /* await browserInstance.switchToParentFrame();
        // @ts-ignore
        const iframe = await browserInstance.findElement("css selector", "iframe");
        let shell;
        if (!iframe.error) {
            const shellConfig = {
                onTheShell: {
                    Shell: {}
                }
            };
            shell = new WDI5FE(shellConfig, browserInstance);
            await loadFELibraries(browserInstance);
            await initOPA(shellConfig, browserInstance);
            // back to app
            await browserInstance.switchToFrame(0);
        }
        else {
            // revert back to app context
            await browserInstance.switchToFrame(null);
        } */
        return new WDI5FE(appConfig, browserInstance);

My test started working.
The Facade initialization did not fail.

Regards,
Sumesh Nair

@nair-sumesh
Copy link
Contributor Author

HI @vobu,

Just a reminder, this is a showstopper as currently all my test fails and due to impacts of webdriverIO.V8 changes, it will be difficult for me to revert my code to older version of WDI5.
Can the fix be taken in priority.

Regards,
Sumesh Nair

@nair-sumesh
Copy link
Contributor Author

@vobu : Just a gentle reminder.
Please let me know how I can help here.

@FrankVisuals
Copy link

+1 for this - we have the same issue and our goal is to always start on the launchpad and not on the app.

@vobu vobu closed this as completed in 6c183e3 Oct 5, 2023
@vobu
Copy link
Contributor

vobu commented Oct 5, 2023

+1 for this - we have the same issue and our goal is to always start on the launchpad and not on the app.

should be fixed with 2.0.2 now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants