robotframework / robotframework/SeleniumLibrary

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

Open
#1,728 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

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

  • Robot Framework: Version 4.0.1
  • SeleniumLibrary: Version 5.1.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the three back-to-back tests with Headless Chrome and compare the condition wait with the title assertion. Trace how the existing title assertion reads the browser title and how waits are implemented. Done means title checks use consistent browser state and the intermittent failure is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.