MarketSquare / MarketSquare/Robot-Framework-Mainframe-3270-Library
"Wait For Field" throws Exception when the timeout is not int
- Dominant language
- Python
- Stars
- 47
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
System: Linux Mint 22.2 (Zara)
Terminal: x3270 (4.1ga10-1.1build2)
Library version: 4.3
Python: 3.12
When the timeout is not set (or is set, does not matter, actually), and "Wait For Field" is triggered, the `self.timeout` is used in "Wait(, InputField)". But it is resolved to a `float` instead of `int` value, so the string formatter builds a string with floating point (like "Wait(30.0, InputField)").
On x3270 it produces `CommandError('Too many arguments to Wait ()or invalid timeout value')`.
The workaround:
`self.exec_command("Wait({0}, InputField)".format(int(self.timeout)).encode("utf-8"))`
Not sure if it affects Windows terminals as well...
P.S.: I'd been using Windows 3270 terminal for a while, but now switched to Linux, so the issue is most likely relates only to Linux.
Contributor guide
Research direction
Locate the "Wait For Field" entry point and trace how self.timeout is formatted into the Wait(, InputField) command. Reproduce it with x3270 on Linux, then verify that the generated command uses an integer timeout and no longer raises the reported CommandError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100