"Table Should Contain" does not work properly
See original GitHub issueExample code: *** Settings *** Library SeleniumLibrary #4.0.0
*** Variables *** ${url} https://www.w3schools.com/html/html_tables.asp ${customer_table} //table[@id=‘customers’]
*** Test Cases *** Sample test Open Browser ${url} browser=chrome Maximize browser window Element Should Be Visible ${customer_table} Table Should Contain ${customer_table} Each
Expected behavior and actual behavior
Expected: FAIL Actual: PASS
If there is given text on the page and even I provide ID of table for this keyword, then this keyword returns True. (table does not contain text)
Table Should Contain
is useless in that case because I can also use Page Should Contain
to find text on the page. In my project, I have two tables on the page where one record is moved to the second table and I need to verify that.
Environment
Browser: Chrome 77.0.3865.90 Browser driver: ChromeDriver 2.42.591088 Operating System: Windows 10 17763.740 Libraries
- Robot Framework: 3.1.2
- Selenium: 3.141.0
- SeleniumLibrary: 4.0.0
- Interpreter: Python 3.7.4
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (8 by maintainers)
Top GitHub Comments
Already fixed locally. Bug also revealed that that there is many other bugs in the same class and I am fixing all of those.
Found the bug, it is in table element finder and Selenium documentation explains why it happens. Good catch, it has been there since 3.0 release.