sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #29658
Re: [Question #258525]: getBundlePath() in Windows returns different slash as os.sep
Question #258525 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/258525
Status: Answered => Solved
Rodolfo confirmed that the question is solved:
Hi RaiMan,
Thanks for your help. I am able now to get to the pictures with the
following code:
script_location = os.path.dirname(getBundlePath())
images_app = os.path.join(script_location, "images", "app")
images_browser = os.path.join(script_location, "images", "browser")
images_login = os.path.join(script_location, "images", "login")
addImagePath(images_app)
addImagePath(images_browser)
addImagePath(images_login)
ImagePath.dump(0) # For debuging only
My project structure looks like this:
** TestImagePath #project folder
**** functional_test #folder
****** test.py
** images #folder
**** app #folder
****** select_course.png
**** browser #folder
****** brightspace.png
****** college_banner.png
**** login #folder
****** login.png
** src #folder
**** app #folder
****** Application.py
**** browser # folder
****** Browser.py
**** login # folder
****** Login.py
The console output is this:
=========================================
console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0.
[error] ImagePath: setBundlePath: invalid BundlePath: null
using working folder: D:\development\workspace\TestImagePaths\functional_test
[debug] ImagePath: ImagePath has 4 entries (valid 4)
[debug] ImagePath: Path: given: D:/development/workspace/TestImagePaths/functional_test
is: D:/development/workspace/TestImagePaths/functional_test
[debug] ImagePath: Path: given: D:/development/workspace/TestImagePaths/images/app
is: D:/development/workspace/TestImagePaths/images/app
[debug] ImagePath: Path: given: D:/development/workspace/TestImagePaths/images/browser
is: D:/development/workspace/TestImagePaths/images/browser
[debug] ImagePath: Path: given: D:/development/workspace/TestImagePaths/images/login
is: D:/development/workspace/TestImagePaths/images/login
[log] App.open C:\Program Files (x86)\Internet Explorer\iexplore.exe(5040)
[log] highlight R[0,0 1920x1048]@S(0)[0,0 1920x1080] E:Y, T:3.0 for 2.0 secs
[log] highlight M[494,66 246x70]@S(S(0)[0,0 1920x1080]) S:1.00 C:617,101 [440/400 msec] for 2.0 secs
Image: brightspace.png was found after 1 tries
[info] Write: #C.l#w1.
[info] Write: #DEL.#w1.
[info] Write: #N.
[log] highlight M[479,246 308x231]@S(S(0)[0,0 1920x1080]) S:0.73 C:633,361 [890/560 msec] for 2.0 secs
Image: login.png was found after 1 tries
[info] Write: qarl-admin
[info] Write: #TAB.
[info] Write: Password)9
[info] Write: #N.
[log] highlight M[478,55 249x29]@S(S(0)[0,0 1920x1080]) S:1.00 C:602,69 [433/50 msec] for 2.0 secs
Image: select_course.png was found after 1 tries
==================================================
I am happy with this solution.
Thanks,
Rodolfo
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.