Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread RaiMan
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

RaiMan proposed the following answer:
--- sites.txt
I admit, that the current implementation is a bit complicated.

- start the IDE
- File Menu -> Open Special files
- 3
- the sites.txt file is opened for edit
- add your paths
- save and close the file
- restart the IDE

the stuff is added at init

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
--- my repacked SikuliX IDE jar
for the sites.txt solution, there is no need to pack anything into the SikuliX 
IDE jar.
A path given in sites.txt is simply added to sys.path at runtime init.

for your cases where are you putting the sites.txt file so that it is picked up 
when running the scripts?
I put it here originally as per the instructions in the docs
C:\Users\richardc\AppData\Roaming\Sikulix\Lib\site-packages
but this didn't work.
The only thing that worked was to put it in
sikulixide-2.0.5\Lib\site-packages
and run 
Sikulix.buildJarFromFolder("F:\Autotester\New Sikuli\sikulixide-2.0.5.jar", 
"F:\Autotester\New Sikuli\sikulixide-2.0.5")
to create a new jar file with it in and use that in place of the original 2.0.5 
IDE jar

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread RaiMan
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

RaiMan proposed the following answer:
got it :-)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
just sent you an email

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread RaiMan
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

RaiMan proposed the following answer:
--- my repacked SikuliX IDE jar
for the sites.txt solution, there is no need to pack anything into the SikuliX 
IDE jar.
A path given in sites.txt is simply added to sys.path at runtime init.

I have a version, that accepts -Dpython.path=some-path
where some-path might either be given
- absolute
- relative to the working directory (including .. placeholder) - the folder 
where the java command is run from.

Since I want to send you the download link exclusively, I need an e-mail 
address (you do not have one here in LP).
mine is sikulix---at---outlook---dot---com.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #247134]: "from org.sikuli.script.natives import Vision" statement not working

2021-07-23 Thread RaiMan
Question #247134 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/247134

RaiMan posted a new comment:
--- 2.0.5

vision is no longer supported since many versions (not sure since when).

It was no longer relevant with the new implementation of OpenCV at the
Java level.

Just remove the 2 lines

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #247134]: "from org.sikuli.script.natives import Vision" statement not working

2021-07-23 Thread Richard Chubb
Question #247134 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/247134

Richard Chubb posted a new comment:
also does not work for 2.0.5.

Where is vision now located?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
Hi, thanks for that RaiMan.
With the hardcoded path in sites.txt, in my repacked SikuliX IDe jar, the 
common modules were imported.
although now I have a new different fail, below. unrelated to this issue I 
suspect, so I will scan the docs and existing questions for a solution.
--
[error] script [ design_loading1 ] stopped with error in line 2
[error] ImportError ( !!WHILE IMPORTING!! No module named natives )
[error] --- Traceback --- error source first
line: module ( function ) statement 
2: commonFunctions (   ) from org.sikuli.script.natives import 
Vision
2: main (   ) from commonFunctions import *
[error] --- Traceback --- end --
--


Thanks for your feedback and response
"Supposing you are using the SikuliX IDE jar, I will create a modified 2.0.5 
version until monday for you, that accepts"
Yes I am using the SikuliX IDE jar.

"In 2.0.6 I will add this as a basic solution (allowing more than 1 path 
separated by ; or :) and additionally the sites.txt accepting relative paths to 
the working folder and with %...% variables taken from current environment."
Both these solutions would be a great option.

thanks for your prompt feedback and the effort in supplying a solution

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread RaiMan
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

RaiMan proposed the following answer:
ok, completely understood.

Supposing you are using the SikuliX IDE jar, I will create a modified 2.0.5 
version until monday for you, that accepts 
-Dpython.path=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts

as you used it before.
I will add a link here, where you can download it then.

In 2.0.6 I will add this as a basic solution (allowing more than 1 path
separated by ; or :) and additionally the sites.txt accepting relative
paths to the working folder and with %...% variables taken from current
environment.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread RaiMan
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Description changed to:
I am having the same issue as in 
https://answers.launchpad.net/sikuli/+question/265660
I have followed the suggestions in that question but it has not resolved my 
issue.

I get the following error

--
[error] script [ design_loading1 ] stopped with error in line 3
[error] ImportError ( No module named commonFunctions )
[error] --- Traceback --- error source first
line: module ( function ) statement 
3: main (   ) from commonFunctions import *
[error] --- Traceback --- end --
-

I was previously using sikuli(x) 1.0.0 and wanted to upgrade to the
latest version to take advantage of some of the newest features
(including the OCR).

Previously the scripts were run from a .bat/.cmd file that issued a
command line to run the sikilu-script.jar, but I see that this is no
longer used and that I should be using the  new sikuli-ide.jar for
running a script from the command line.

The previous command issued was :

"C:/Program Files (x86)/\Java\jre1.8.0_271\bin\java.exe" -Xms64M
-Xmx512M -Dfile.encoding=UTF-8
-Dpython.path=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts
-jar
"C:\Users\richardc\dev\eCS21_1_tpmgr\ncs_autotest\utils\Sikuli\sikuli-
script.jar" -r
C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/ncs_vbp_p/start/SikuliScripts/design_loading1.sikuli

where Dpython.path is the location of the common scripts.

Trying to run the exact same script using the new version (2.0.5) and
the command I use is the following:

"C:\Program Files\Java\jre1.8.0_291\bin\java.exe" -Xms64M -Xmx512M
-Dfile.encoding=UTF-8
-Dpython.path=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts
-jar
"C:\Users\richardc\dev\eCS21_1_tpmgr\ncs_autotest\utils\Sikuli\sikulixide-2.0.5.jar"
-r
C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/ncs_vbp_p/start/SikuliScripts/design_loading1.sikuli

I have tried setting up the PYTHONPATH, JYTHONPATH and CLASSPATH but
this had no affect.

... log deleted - not relevant

as can be seen my required path is not being added to sys.path.


Any help would be appreciated.
Thaknks

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
The sites_examples.txt states
# rename/copy this file as sites.txt and it will be seen by SikuliX
#
# add absolute paths one per line, that point to other directories/jars,
# where importable modules (Jython, plain Python, SikuliX scripts, ...) can be 
found.
# They will be added automatically at startup to the end of sys.path in the 
given sequence
#
# lines beginning with # or // are ignored and can be used as comments

but I can't use absolute paths, because the tests/scripts are run on different 
machines.
Can I use a defined env var e.g. %NCS_SIKULI_COMMON% ?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
Thanks for the feedback RaiMan.

"
I have 3 solutions:
--- JYTHONPATH
Set it in the environment and use the python features to extract it at runtime

--- parameter
add the path as parameter after -- to the command line

... in both cases you can now add the path to sys.path at runtime

--- site-packages
see 
https://sikulix-2014.readthedocs.io/en/latest/scenarios.html#access-python-packages-from-sikulix-scripts-run-by-sikulix-gui-or-commandline
"

for the first point:
do you mean set it up in system/user environment variables? If so this is not a 
viable solution. These are autotests/regession tests that are run on all sort 
of machines and we can't rely on env vars set on each machine, so we have to 
set up any env vars in the scripts every time a test is run, which is why I was 
trying to use 'set JYTHONPATH..'.

What do you mean by 'extract it at runtime'?
do you mean in the actual sikuli script? Again this is not a viable solution as 
there a 1s of scripts that would need changing, I need a common soultion.

for the second point:
can you please explain what you mean with an example perhaps?
do you mean add it as optional command line parameter?

'in both cases you can add the path to sys.path at runtime'
if you mean in the sikuli scripts themselves, then as above that is not a 
viable solution as I need a common solution.

For the third point:
I did start looking into this, but I ran into some difficulties.
I added the path to sites.txt  in the app data location but that was not 
getting copied to the scripts lib location.
I think the scripts copy of sikulix and the lib folder is coming from the .jar 
file.
I tried to add this in but I do not know the metho to add to a .jar file, I can 
extract the .jar using 7-zip but I couldn't find out how to create the new .jar 
after adding the file in.
I did have a look at that page that you linked to , but will take another look 
because it looks like it may be able to tell me how to repack the .jar.


thanks in advance

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread RaiMan
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Status: Open => Answered

RaiMan proposed the following answer:
--- I have tried setting up the PYTHONPATH, JYTHONPATH and CLASSPATH but this 
had no affect.
This only works, if you are running with Jython from command line.
... but this is not possible easily with 2.0.5, since Jython is bundled

I have 3 solutions:
--- JYTHONPATH 
Set it in the environment and use the python features to extract it at runtime 

--- parameter
add the path as parameter after -- to the command line 

... in both cases you can now add the path to sys.path at runtime

--- site-packages
see 
https://sikulix-2014.readthedocs.io/en/latest/scenarios.html#access-python-packages-from-sikulix-scripts-run-by-sikulix-gui-or-commandline

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #697889]: How to initiate remote webdriver using selenium commands in sikuli

2021-07-23 Thread Launchpad Janitor
Question #697889 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/697889

Status: Open => Expired

Launchpad Janitor expired the question:
This question was expired because it remained in the 'Open' state
without activity for the last 15 days.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698118]: my script reacts too slow when detecting the image, how to improve it?

2021-07-23 Thread RaiMan
Question #698118 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698118

RaiMan proposed the following answer:
if nothing else is said, images are searched on the whole screen.
The search would be faster, if you restrict the region as much as possible to 
the area, where you expect the image to appear.

On large screens in most cases it is enough to restrict to the app window:
searchArea = App.focusedWindow()

now you might define additional search areas relative to the (x,y) of your 
primary area
see: 
https://sikulix-2014.readthedocs.io/en/latest/region.html#extend-regions-and-create-new-regions-based-on-existing-regions

I do not understand, why you click 4 times using the image:
if exists(fishButton):
for x in range(4):
click (fishButton)

my variant:
click(wait(fishButton))

or for more control:
if exists(fishButton):
click() # clicks on the last match

now a region, where you expect things to happen:
reg = ... # somehow define it

if reg.exists(fishAppear, 2 * 60):
reg.click(getFish) # see comment

comment: this should work, since if nothing else is said, the search
repeats for 3 seconds.

Another aspect to look at: Settings.WaitScanRate
This 3 in the standard, meaning 3 searches per second max, which normally is 
sufficient.

In special cases, when you have small search areas, where a search might take 
only some 10 milli secs you might raise this value to a higher value (e.g. 10 
means max 10 searches per second, which only makes sense, if searches ar faster 
then 100 milli secs).
Higher values don't do any harm, but only have an effect, if the search times 
fit.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698118]: my script reacts too slow when detecting the image, how to improve it?

2021-07-23 Thread Manfred Hampl
Question #698118 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698118

Status: Open => Answered

Manfred Hampl proposed the following answer:
see e.g. https://answers.launchpad.net/sikuli/+question/663281

make search region as small as possible around the place where you
expect the image to appear.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp