Hi all,
I'm trying to wrap up the STB-Tester APIs so I can use them with other automation tools e.g. Selenium, Robot Framework, etc.
And I do notice this blog page on STBT website https://stb-tester.com/blog/2016/09/20/add-visual-verification-to-your-selenium-tests-with-stb-tester
Following the idea from that blog, I successfully empowered my Selenium test with STBT image compare.
Now I’m thinking if it would be possible for me to wrap up the Python APIs so they can be available in Robot Framework. I first tried with Robot Framework Selenium2Library + stbt.match and it was working.
However, when I try stbt.press with code
def press_key(key='Home'):
stbt.press(key)I got error message ‘AttributeError: 'NoneType' object has no attribute 'press'’ which I don’ t understand cause if I define
def printer():
return dir(stbt)I can get
['ConfigurationError', 'Frame', 'FrameObject', 'MatchParameters', 'MatchResult', 'MatchTimeout', 'MotionResult', 'MotionTimeout', 'NoVideo', 'OcrMode', 'Position', 'PreconditionError', 'Region', 'TextMatchResult', 'UITestError', 'UITestFailure', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '_dut', '_libexecdir', '_stbt', '_vars', 'absolute_import', 'as_precondition', 'debug', 'detect_match', 'detect_motion', 'draw_text', 'frames', 'get_config', 'get_frame', 'init_run', 'is_screen_black', 'match', 'match_all', 'match_text', 'ocr', 'press', 'press_until_match', 'save_frame', 'sys', 'teardown_run', 'wait_for_match', 'wait_for_motion', 'wait_until']Many thanks
Ken
ctrl = _stbt.control.uri_to_remote(<remote uri here/stbt.get_config>)
ctrl.press('Home')