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

fix: correctly switch between iframes on disable animation #820

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

DudaGod
Copy link
Member

@DudaGod DudaGod commented Dec 26, 2023

No description provided.

@@ -305,12 +305,12 @@ module.exports = class ExistingBrowser extends Browser {
for (const iframe of iframes) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Проблема возникала когда на странице оказывалось 2 айфрейма. После перехода в первый и выполнения отключения анимации осуществлялся сразу же переход в следующий. При этом контекст оставался в предыдущем фрейме. В итоге летела не очень понятная ошибка: stale element reference: element is not attached to the page document.

В итоге теперь после отключения анимации в одном из айфреймов сразу же возвращаюсь в родителя. За счет этого проблема больше не воспроизводится.

// switchToParentFrame does not work in ios - https://github.com/appium/appium/issues/14882
await this._session.switchToFrame(null);
}
} catch (e) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вместо finally теперь свитч в родителя выполняю в catch

Copy link
Member

@KuznetsovRoman KuznetsovRoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok

@DudaGod DudaGod force-pushed the HERMIONE-1305.fix_stale_element_ref branch from e21a0e4 to eabea08 Compare December 27, 2023 11:39
@DudaGod DudaGod merged commit 5bbed80 into master Dec 27, 2023
2 checks passed
@DudaGod DudaGod deleted the HERMIONE-1305.fix_stale_element_ref branch December 27, 2023 11:41
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

Successfully merging this pull request may close these issues.

2 participants