UI test logger has wrong expectations on vertical tabs

Ilmari Lauhakangas ilmari.lauhakangas at libreoffice.org
Wed Dec 1 18:45:23 UTC 2021

I was going to write a small Python UI test concerning Writer hyperlink 
tab focus and decided to try our test logger. It turns out the 
log-to-test converter expects some UI element ID values to be numeric 
while they are not. I couldn't figure out how to fix it.

I followed 

Installed python-textx package.

LO_COLLECT_UIINFO="test.log" SAL_USE_VCLPLUGIN=gen instdir/program/soffice

Opened Writer and Ctrl-K to insert hyperlink, canceled and quit.

cd uitest/ui_logger_dsl

python dsl_core.py /home/user/libreoffice/instdir/uitest/test.log 

The log file has a line:
Choose Tab number internet in 'tabcontrol' from

and dsl_core.py fails on the line with:
textx.exceptions.TextXSyntaxError: None:6:19: error: Expected INT at 
position /home/user/libreoffice/instdir/uitest/test.log:(6, 19) => 'ab 
number *internet i'.

In uitest/ui_logger_dsl/UI_Object_commands.tx we have:
    'Choose Tab number' tab_page_number=INT 'in' tab_id=STRING ('from' 

It doesn't matter, if I change tab_page_number=STRING, it errors saying 
it expected STRING as if internet was not a string?!?

In a gdb session I checked the contents of the parameters

break /home/user/libreoffice/vcl/source/uitest/logger.cxx:599

Thread 1 "soffice.bin" hit Breakpoint 1, UITestLogger::logEvent 
(this=0x555556cc9510, rDescription=...) at 
600             aLogLine = "Choose Tab number " + 
GetValueInMapWithIndex(rDescription.aParameters, 0)
(gdb) p rDescription
$1 = (const EventDescription &) @0x7fffffffb1f0: {aKeyWord = 
"VerticalTab", aAction = "SELECT", aID = "tabcontrol", aParent = "",
   aParameters = std::__debug::map with 1 element = {["POS"] = "internet"}}

Relevant commits:

I know this tool is underused, but it would be nice to make sure it 
works and maybe we will start using it more :)


More information about the LibreOffice mailing list