Skip to content

Can't find element in the rewritten iframe via Selector.withText #5886

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

Closed
wentwrong opened this issue Jan 21, 2021 · 0 comments · Fixed by #5887
Closed

Can't find element in the rewritten iframe via Selector.withText #5886

wentwrong opened this issue Jan 21, 2021 · 0 comments · Fixed by #5887
Assignees
Labels
AREA: client SYSTEM: API TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@wentwrong
Copy link
Contributor

wentwrong commented Jan 21, 2021

After switching to the iframe with dynamically created document, TestCafe can't find the existing element:

AssertionError: expected false to be truthy

      + expected - actual

      -false
      +undefined


      Browser: Chrome 87.0.4280.141 / Windows 10 

          3 |fixture`Test`.page`http://localhost:3000/`;
          4 |
          5 |test('test', async t => {
          6 |    await t
          7 |        .switchToIframe('#frame')
       >  8 |        .expect(Selector('#test').withText('The Test Text').exists).ok();
          9 |});
         10 |

Although the element described by such selector present in the iframe. But if we replace "withText" method with "withExactText" then the test will pass successfully.

testcafe-iframe-bug.zip

@wentwrong wentwrong added TYPE: bug The described behavior is considered as wrong (bug). AREA: client SYSTEM: API labels Jan 21, 2021
@wentwrong wentwrong self-assigned this Jan 21, 2021
@AndreyBelym AndreyBelym added this to the Sprint #73 milestone Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: client SYSTEM: API TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants