Comments (5)
There may be a couple of reasons why opening the screen lock does not work.
First, you may want to extend screen lock timeout. This is probably a good idea even if it would not solve this problem. For instance, keep display on up to five minutes of inactivity:
d.setDisplayBacklightTime(5 * 60)
Second, the first screenshot may not be from the lockscreen. You can check from device.html what graphics were actually received on the screenshot taken on the 6th line of your code. Check out the screenshot after refreshScreenshot() on device.html:
chromium device.html
If the screenshot is not from the lockscreen, time.sleep(1) on line on the 5th line is not long enough, you'll need to make it longer.
If the screenshot is from the lockscreen, the next question is if "lock.png" is recognised on it. If d.verifyBitmap("lock.png") returned False (see the next item on device.html), then it was not recognised. The reason may be in color palette or rendering differences. These can be overcome by giving an extra OIR (optical image recognition) parameter to verifyBitmap method. For instance, try d.verifyBitmap("lock.png", colorMatch=0.8). If extra parameters are really needed, it's convenient to write them to .fmbtoirrc file in the same directory where lock.png is located, so you do not need to write them everywhere in the test code. An example of .fmbtoirrc file with OIR parameters that are pretty robust against rendering/palette differences, but that is still very reliable (false positive matches are highly unlikely):
colorMatch = 0.9
bitmapPixelSize = 2
screenshotPixelSize = 2
If "lock.png" is successfully recognised on the lockscreen screenshot, then pretty much the last things that may go wrong is that the location of "lock.png" on the screen, and the distance of the swipe gesture. swipeBitmap("lock.png", "east") swipes from the middle of the "lock.png" area until the right edge of the display. Here's a reference bitmap that I used on Tizen 2.2 on my d.swipeBitmap("lockscreen-lock.png", "east") call:
...and you can adjust the distance of the swipe with the "distance" parameter. For instance,
d.swipeBitmap("lock.png", "east", distance=0.9)
swipes from the middle of the bitmap, towards the right edge of the display, and raises the "finger" after 90 % of the whole distance has been travelled.
Please let me know if you got the problem solved with these tips!
from fmbt.
Thanks, d.setDisplayBacklightTime(5 * 60) works ok, and an image lock.png wasn't recognized, you was right. I have different lockscreen, and I think that for me it would be easy to swipe on the "Charge" word - is there any place where I can learn about API usage, that isn't presented in the tutorial?
from fmbt.
I've just added an overview of fMBT GUI testing APIs here:
https://github.com/01org/fMBT/wiki/GUI-testing
Depending on the font, background and a bit of luck, this may work for you:
d.swipeOcrText("Charge", "east")
Unfortunately, OCR is quite unreliable, and sometimes you'll need magic like
d.swipeOcrText("Charge", "east", match=0.5)
to find a match. To make the test faster and more reliable, it's probably better to use a reference bitmap "charge.png" that contains the label.
from fmbt.
Closing the issue.
from fmbt.
Thanks!
from fmbt.
Related Issues (20)
- fmbt-editor and fmbt-scripter: ImportError: No module named fmbt_config HOT 5
- failed to install python on tizen device HOT 2
- OS X build HOT 16
- [fmbttizen]How did you get screenshot from Tizen device HOT 1
- Error : "cannot update screenshot, no connection" When i try to Refresh Screenshot in fmbt-scripter for tizen HOT 3
- fmbt-editor not found HOT 4
- Typing non-ascii characters doesn't work HOT 4
- general question: when modeling, should i seperate data combination and path combination? HOT 3
- using multiprocessing in aal model with heuristic lookahead HOT 3
- fmbt-log seperater not working HOT 4
- using model as an adapter only ? HOT 1
- fmbt on windows doesn't seem to be able to create subprocess HOT 3
- ways to find which action haven't been covered? HOT 1
- adapter questions HOT 1
- Connecting to Tizen Device/emulator failed. Error: Agent connection HOT 3
- FMBT windows installer error - libpcre-1.dll is missing HOT 5
- java-unittest example not working
- can I use it on Tizen wearable? HOT 2
- fmbt-scripter.exe error HOT 2
- Display of error empty: fmbt3-editor tries to search contents of byte String, but should search decoded string instead
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmbt.