Sikuli script stops working without throwing any error or any exception, it just waits where there is no wait function

Asked by Yesh Biswakarma

I have written a Sikuli Script, the script is working fine on windows 10, all the methods and functions used are working totally fine.
But when i run the same script on Windows Server 2012 with Media Foundation installed, the script runs and it can find the images which are needed, But the script keeps on waiting after 3/4 runs in the middle of the loop and does not throw any kind of error or any exception, it just waits, where i am not using any wait() function

Script is something like it collects or fetches data from a Region using Region.text()
Below is the sample code structure :

if len(mrn) !=0:
    for i in mrn:
        wait(1)
        name = Region.text()
        age = Region.text()
        phone_number = Region.text()
        address = Region.text()
        dob = Region.text()

What happens is in the first 3 runs of the loop , the data is being fetched successfully and correctly, then on 4th run or maybe subsequent run in the loop, it waits and keeps on waiting.
for example-
1st run - name, age, phone_number, address, dob is fetched
2nd run - name, age, phone_number, address, dob is fetched
3rd run - name, age, phone_number, address, dob is fetched
4th run - name, age is fetched, but keeps on waiting afterwards to fetch phone_number without throwing any error
If I bypass, say phone_number = ' ', then
4th run - name, age, phone_number, address, dob is fetched
and in the 5th run
5th run - name, age, phone_number, address is fetched, but keeps on waiting afterwards to fetch dobwithout throwing any error

What am i doing wrong, I have put every attributes i.e., name, age, phone_number, address, dob inside try and except block, but still facing this issue

Is there any way that we can wait for 5 seconds for fetching each attribute, if the scripts waits for 5 seconds and didnot fetched any data, we can move on to other attribute to be fetched. Example, in the 4th run, while fetching phone_number the scripts unexpectedly waits, Here we can check if in between 5 seconds, phone number is not fetched, we can set phone_number = '' and continue to fetch other details as required.

Note: Keep in mind before answering that the same script runs perfectly on Windows 10, but on Windows Server 2012 with Media Foundation installed and being able to find images and read texts from Region, unexpectedly waits and waits without throwing any error or exception. I have to force stop the program using CTRL+C on command line

Thank you, any help would be appreciated.

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

what version of SikuliX?
what Java?

Revision history for this message
Yesh Biswakarma (yash6238) said :
#2

SikuliX Version 2.0.5
Java Version 18

Revision history for this message
Yesh Biswakarma (yash6238) said :
#3

@RaiMan Please look into this matter, Any help would be appreciated.

Revision history for this message
Yesh Biswakarma (yash6238) said :
#4

CommandLine Logs- After 3rd Run
{for name}: ABC
{for age}: 26
{for phone_number}: Here no output of Region.text() is shown, Also no kind errors or exception is thrown. Here the script keeps on waiting, without anykind of wait() or timeout

Revision history for this message
RaiMan (raimund-hocke) said :
#5

my test on Windows 11 Java 11:

r = Region(75,106,50,16) # 1st part of a longer text line
rx = r.x # remember start x
for i in range(1000 ):
    popup("test" + str(i), 1) # waits 1 second and auto closes
    print 1, r.text() # 1st part
    r.x += 50
    print 2, r.text() # 2nd part
    r.x += 50
    print 3, r.text() # 3rd part
    r.x += 50
    print 4, r.text() # 4th part
    r.x = rx # reset to start x

The 4000 text() calls worked without any problems.

It must be specific to the server environment.

Take care, that the monitor is always on and not locked.

Revision history for this message
Yesh Biswakarma (yash6238) said :
#6

When after selecting a region and extracting text using Region.text(), the script first runs normally. in the loop , the loop runs for 3-4 times and after that, the script keeps on waiting without throwing any error or exception. I have put my code inside try except block, but it cannot bypass the try except block and the script goes into infinite wait

Revision history for this message
RaiMan (raimund-hocke) said :
#7

No chance to help without having a text sample and the real script, that fails.

Revision history for this message
Yesh Biswakarma (yash6238) said :
#8

Okk

On Fri, Apr 21, 2023, 7:55 PM RaiMan <email address hidden>
wrote:

> Your question #706028 on SikuliX changed:
> https://answers.launchpad.net/sikuli/+question/706028
>
> RaiMan proposed the following answer:
> No chance to help without having a text sample and the real script, that
> fails.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/sikuli/+question/706028/+confirm?answer_id=6
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/sikuli/+question/706028
>
> You received this question notification because you asked the question.
>

Revision history for this message
RaiMan (raimund-hocke) said :
#9

no reaction