robotframework / SeleniumLibrary

Web testing library for Robot Framework
Apache License 2.0
1.39k stars 763 forks source link

Wait For Condition and Title Should Be seem to be out of sync #1728

Open nathanhannig opened 3 years ago

nathanhannig commented 3 years ago

For issues

Steps to reproduce the issue

I noticed when running headlesschrome I get a failure versus using chrome which passes. I think the Javascript changes before the self.driver.title does on headlesschrome

I have the following code

  Wait For Condition  return document.title === 'Title of Website'
  Title Should Be  Title of Website

I have this code running in three back to back tests, the first one is the one that fails the most; but it isn't guaranteed. This concerns me that it might not be easily reproducible.

For a solution; I think implementing a Wait Unit Title Is keyword would be best to implement so it is using the self.driver.title property to match Title Should Be.

Error messages and additional information

Title should have been 'Title of Website' but was 'Sign In Page'.

Browser: Headlesschrome Browser driver: Chrome Operating System: Windows 10 Libraries

nathanhannig commented 3 years ago

I am also thinking it would be nice to add a Wait Unitl Title Is Wait Unitl Title Is Not

Antimatterr commented 1 year ago

I am also thinking it would be nice to add a Wait Unitl Title Is Wait Unitl Title Is Not

yes I want this keyword, so how can we implement this in robot as my website title changes after 5-10second and if i use Title should be keyword it will show me and error