This test works when I am asking to only click on one of the buttons “Cancel or OK”. Now that I am asking to the user to enter a number and select a button the test does not work anymore.
the result of pressing the Cancel button is error number -128 (user cancelled),
you need a repeat loop to catch the error if the user enters a non-number value.
To check which button has been pressed is actually not necessary.
Cancel and OK are the default buttons so you don’t have to specify them