← Back to team overview

sikuli-driver team mailing list archive

[Bug 1856450] Re: Extra Click being added by IDE during loop

 

** Description changed:

  Hi,
  the following script is designed to loop through a menu item until it fins the one it is looking for and when it does it stops the loop and is supposed to click a confirm button which takes the screen to another page. However what is happening is that the IDE finds the correct option but adds another click which takes the menu on to the next option before it clicks confirm which means it is confirming the wrong item. In the log file the extra click does not seems to be recorded but it does happen. Below is the code snippet and the logfile with debug(3) set. As far as I can tell the code logic is sound but if there is a problem with it which is causing the extra click please point it out. The code is looking for "BMW 2002 TURBO" but it is find that and then clicking on:
  
  try:
-     while found == 0:      
-               print("About to click")       
-               click("1576020708907.png")
-               print("clicking")
-               current_model = model_region.text()
-               wait(1)
+     while found == 0:
+               print("About to click")
+               click("1576020708907.png")
+               print("clicking")
+               current_model = model_region.text()
+               wait(1)
  
-               if current_model == find_model:
-                     print("Found It")
-                     found = 1
-                     print ("Found is = ",found)
-                     click("1576403393174.png")
-                     break
-                     # wait(5)
-                    
-               elif current_model == "ANY":
-                     print("Did Not Find -->",find_model)
-                     break
- except:    
-    print("Caught exception ")
+               if current_model == find_model:
+                     print("Found It")
+                     found = 1
+                     print ("Found is = ",found)
+                     click("1576403393174.png")
+                     break
+                     # wait(5)
+ 
+               elif current_model == "ANY":
+                     print("Did Not Find -->",find_model)
+                     break
+ except:
+    print("Caught exception ")
  
  The debug output is:
- [debug] HotkeyManager: add  Hotkey: CTRL F1 (112, 2)
- [debug] Image: reused: 1575998355996.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998355996.png)
- [debug] Region: wait: waiting 3.0 secs for 1575998355996.png to appear in R[0,0 1680x1050]@S(0)
- [debug] Finder2: makeMat: INT_RGB (43x22)
- [debug] Finder2: makeMat: 3BYTE_BGR (43x22)
- [debug] Finder2: doFind: start (stdDev: 123.8099 mean: 673.958774)
- [debug] Finder2: doFind: in original: %0.0000 (?99) 0 msec 
- [debug] Finder2: doFind: end 0 msec
- [debug] Region: checkLastSeen: not there
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: makeMat: 3BYTE_BGR (43x22)
- [debug] Finder2: doFind: start (stdDev: 123.8099 mean: 673.958774)
- [debug] Finder2: doFind: in original: %98.5212 (?80) 130 msec 
- [debug] Finder2: doFind: end 130 msec
- [debug] Region: wait: 1575998355996.png appeared (M[1072,204 43x22]@S(0) S:0.99 C:1093,215 [181 msec])
- [debug] DOUBLE CLICK on L[1093,215]@S(0) (570 msec)
- [debug] Image: reused: 1575998402284.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998402284.png)
- [debug] Region: wait: waiting 3.0 secs for 1575998402284.png to appear in R[0,0 1680x1050]@S(0)
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: makeMat: 3BYTE_BGR (158x29)
- [debug] Finder2: doFind: start (stdDev: 287.3884 mean: 251.658010)
- [debug] Finder2: doFind: in original: %40.2877 (?70) 160 msec 
- [debug] Finder2: doFind: end 160 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 287.3884 mean: 251.658010)
- [debug] Finder2: doFind: in original: %95.5664 (?70) 172 msec 
- [debug] Finder2: doFind: end 172 msec
- [debug] Region: wait: 1575998402284.png appeared (M[759,504 158x29]@S(0) S:0.96 C:838,518 [551 msec])
- [debug] Image: reused: 1575998609275.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998609275.png)
- [debug] Region: wait: waiting 3.0 secs for 1575998609275.png to appear in R[0,0 1680x1050]@S(0)
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: makeMat: 3BYTE_BGR (150x22)
- [debug] Finder2: doFind: start (stdDev: 284.4761 mean: 359.097576)
- [debug] Finder2: doFind: in original: %99.4264 (?70) 157 msec 
- [debug] Finder2: doFind: end 157 msec
- [debug] Region: wait: 1575998609275.png appeared (M[763,506 150x22]@S(0) S:0.99 C:838,517 [202 msec])
- [debug] CLICK on L[838,517]@S(0) (531 msec)
- [debug] Image: reused: 1575998641601.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998641601.png)
- [debug] Region: wait: waiting 3.0 secs for 1575998641601.png to appear in R[0,0 1680x1050]@S(0)
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: makeMat: 3BYTE_BGR (35x21)
- [debug] Finder2: doFind: start (stdDev: 110.1870 mean: 397.500680)
- [debug] Finder2: doFind: in original: %47.0695 (?70) 136 msec 
- [debug] Finder2: doFind: end 136 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 110.1870 mean: 397.500680)
- [debug] Finder2: doFind: in original: %97.8258 (?70) 130 msec 
- [debug] Finder2: doFind: end 130 msec
- [debug] Region: wait: 1575998641601.png appeared (M[827,549 35x21]@S(0) S:0.98 C:844,559 [519 msec])
- [debug] CLICK on L[844,559]@S(0) (532 msec)
- [debug] Image: reused: 1575998671670.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998671670.png)
- [debug] Region: wait: waiting 5.0 secs for 1575998671670.png to appear in R[0,0 1680x1050]@S(0)
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: makeMat: 3BYTE_BGR (115x37)
- [debug] Finder2: doFind: start (stdDev: 166.4156 mean: 652.980964)
- [debug] Finder2: doFind: in original: %63.3083 (?70) 138 msec 
- [debug] Finder2: doFind: end 138 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 166.4156 mean: 652.980964)
- [debug] Finder2: doFind: in original: %87.6191 (?70) 136 msec 
- [debug] Finder2: doFind: end 136 msec
- [debug] Region: wait: 1575998671670.png appeared (M[371,198 115x37]@S(0) S:0.88 C:428,216 [519 msec])
- [debug] Image: reused: 1575998703007.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998703007.png)
- [debug] Region: wait: waiting 3.0 secs for 1575998703007.png to appear in R[0,0 1680x1050]@S(0)
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: makeMat: 3BYTE_BGR (99x23)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %63.1547 (?70) 161 msec 
- [debug] Finder2: doFind: end 161 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %63.1823 (?70) 151 msec 
- [debug] Finder2: doFind: end 151 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %62.7462 (?70) 153 msec 
- [debug] Finder2: doFind: end 153 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %62.7462 (?70) 149 msec 
- [debug] Finder2: doFind: end 150 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %62.7463 (?70) 142 msec 
- [debug] Finder2: doFind: end 142 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %62.7462 (?70) 141 msec 
- [debug] Finder2: doFind: end 141 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %62.7462 (?70) 146 msec 
- [debug] Finder2: doFind: end 146 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %62.7463 (?70) 143 msec 
- [debug] Finder2: doFind: end 143 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 111.1303 mean: 647.409750)
- [debug] Finder2: doFind: in original: %99.9999 (?70) 137 msec 
- [debug] Finder2: doFind: end 137 msec
- [debug] Region: wait: 1575998703007.png appeared (M[891,202 99x23]@S(0) S:1.00 C:940,213 [2851 msec])
- [debug] Ctrl+Alt + CLICK on L[940,213]@S(0) (573 msec)
- [debug] CLICK on L[429,503]@S(0) (531 msec)
- [debug] Image: reused: 1575998834354.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575998834354.png)
- [debug] Region: wait: waiting 3.0 secs for 1575998834354.png to appear in R[0,0 1680x1050]@S(0)
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: makeMat: 3BYTE_BGR (67x33)
- [debug] Finder2: doFind: start (stdDev: 67.1761 mean: 739.393487)
- [debug] Finder2: doFind: in original: %54.5179 (?70) 154 msec 
- [debug] Finder2: doFind: end 154 msec
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: doFind: start (stdDev: 67.1761 mean: 739.393487)
- [debug] Finder2: doFind: in original: %76.6584 (?70) 159 msec 
- [debug] Finder2: doFind: end 159 msec
- [debug] Region: wait: 1575998834354.png appeared (M[576,418 67x33]@S(0) S:0.77 C:609,434 [538 msec])
- [debug] Image: reused: 1575999447617.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1575999447617.png)
- [debug] Region: wait: waiting 3.0 secs for 1575999447617.png to appear in R[0,0 1680x1050]@S(0)
- [debug] Finder2: makeMat: INT_RGB (1680x1050)
- [debug] Finder2: makeMat: 3BYTE_BGR (76x29)
- [debug] Finder2: doFind: start (stdDev: 67.2672 mean: 739.312160)
- [debug] Finder2: doFind: in original: %100.0000 (?70) 136 msec 
- [debug] Finder2: doFind: end 136 msec
- [debug] Region: wait: 1575999447617.png appeared (M[572,416 76x29]@S(0) S:1.00 C:610,430 [180 msec])
- [debug] CLICK on L[610,430]@S(0) (534 msec)
- [debug] Finder2: makeMat: INT_RGB (233x37)
+ .... more ...
  [debug] highlight R[1157,402 233x37]@S(0) for 2.0 secs
  ('M is -->', 'BMW |')
  ('Storecar is -->', 'BMW')
  exact match
  [debug] DOUBLE CLICK on L[1273,420]@S(0) (558 msec)
  [debug] Image: reused: 1576019906865.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1576019906865.png)
  [debug] Region: wait: waiting 3.0 secs for 1576019906865.png to appear in R[0,0 1680x1050]@S(0)
  [debug] Finder2: makeMat: INT_RGB (1680x1050)
  [debug] Finder2: makeMat: 3BYTE_BGR (56x32)
  [debug] Finder2: doFind: start (stdDev: 78.4400 mean: 732.756696)
- [debug] Finder2: doFind: in original: %38.1498 (?70) 137 msec 
+ [debug] Finder2: doFind: in original: %38.1498 (?70) 137 msec
  [debug] Finder2: doFind: end 137 msec
  [debug] Finder2: makeMat: INT_RGB (1680x1050)
  [debug] Finder2: doFind: start (stdDev: 78.4400 mean: 732.756696)
- [debug] Finder2: doFind: in original: %98.6683 (?70) 135 msec 
+ [debug] Finder2: doFind: in original: %98.6683 (?70) 135 msec
  [debug] Finder2: doFind: end 135 msec
  [debug] Region: wait: 1576019906865.png appeared (M[788,457 56x32]@S(0) S:0.99 C:816,473 [510 msec])
  [debug] CLICK on L[816,473]@S(0) (523 msec)
  [debug] Finder2: makeMat: INT_RGB (223x36)
  [debug] Image: reused: 1576020708907.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1576020708907.png)
  [debug] Region: wait: waiting 3.0 secs for 1576020708907.png to appear in R[0,0 1680x1050]@S(0)
  [debug] Finder2: makeMat: INT_RGB (1680x1050)
  About to click
  [debug] Finder2: makeMat: 3BYTE_BGR (44x43)
  [debug] Finder2: doFind: start (stdDev: 129.9894 mean: 383.493658)
- [debug] Finder2: doFind: in original: %93.2096 (?70) 128 msec 
+ [debug] Finder2: doFind: in original: %93.2096 (?70) 128 msec
  [debug] Finder2: doFind: end 128 msec
  [debug] Region: wait: 1576020708907.png appeared (M[789,451 44x43]@S(0) S:0.93 C:811,472 [167 msec])
  clicking
  [debug] CLICK on L[811,472]@S(0) (527 msec)
  [debug] Finder2: makeMat: INT_RGB (223x36)
  ('Did Not Find -->', 'BMW 2002 TURBO')
  
  The IDE version is 2.0.1 running on Windows 10 64 bit Version
  10.0.18362 Build 18362

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1856450

Title:
  Extra Click being added by IDE during loop

Status in Sikuli:
  New

Bug description:
  Hi,
  the following script is designed to loop through a menu item until it fins the one it is looking for and when it does it stops the loop and is supposed to click a confirm button which takes the screen to another page. However what is happening is that the IDE finds the correct option but adds another click which takes the menu on to the next option before it clicks confirm which means it is confirming the wrong item. In the log file the extra click does not seems to be recorded but it does happen. Below is the code snippet and the logfile with debug(3) set. As far as I can tell the code logic is sound but if there is a problem with it which is causing the extra click please point it out. The code is looking for "BMW 2002 TURBO" but it is find that and then clicking on:

  try:
      while found == 0:
                print("About to click")
                click("1576020708907.png")
                print("clicking")
                current_model = model_region.text()
                wait(1)

                if current_model == find_model:
                      print("Found It")
                      found = 1
                      print ("Found is = ",found)
                      click("1576403393174.png")
                      break
                      # wait(5)

                elif current_model == "ANY":
                      print("Did Not Find -->",find_model)
                      break
  except:
     print("Caught exception ")

  The debug output is:
  .... more ...
  [debug] highlight R[1157,402 233x37]@S(0) for 2.0 secs
  ('M is -->', 'BMW |')
  ('Storecar is -->', 'BMW')
  exact match
  [debug] DOUBLE CLICK on L[1273,420]@S(0) (558 msec)
  [debug] Image: reused: 1576019906865.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1576019906865.png)
  [debug] Region: wait: waiting 3.0 secs for 1576019906865.png to appear in R[0,0 1680x1050]@S(0)
  ....
  [debug] Region: wait: 1576019906865.png appeared (M[788,457 56x32]@S(0) S:0.99 C:816,473 [510 msec])
  [debug] CLICK on L[816,473]@S(0) (523 msec)
  [debug] Finder2: makeMat: INT_RGB (223x36)
  [debug] Image: reused: 1576020708907.png (file:C:\Users\mmcguinn\Documents\Mensel.sikuli\1576020708907.png)
  [debug] Region: wait: waiting 3.0 secs for 1576020708907.png to appear in R[0,0 1680x1050]@S(0)
  About to click
  ....
  [debug] Region: wait: 1576020708907.png appeared (M[789,451 44x43]@S(0) S:0.93 C:811,472 [167 msec])
  clicking
  [debug] CLICK on L[811,472]@S(0) (527 msec)
  [debug] Finder2: makeMat: INT_RGB (223x36)
  ('Did Not Find -->', 'BMW 2002 TURBO')

  The IDE version is 2.0.1 running on Windows 10 64 bit Version
  10.0.18362 Build 18362

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1856450/+subscriptions


References