How to use run_keyword method in robotframework-pageobjects

Best Python code snippet using robotframework-pageobjects_python

sikuliwrapper.py

Source:sikuliwrapper.py Github

copy

Full Screen

...4 def __init__(self):5 self.sikuli = SikuliLibrary(mode='NEW')6 def add_image_path(self, path):7 arguments = [path]8 self.sikuli.run_keyword("addImagePath", arguments)9 def capture_screen(self):10 return self.sikuli.run_keyword("captureScreen")11 def change_screen_id(self, screen_id):12 arguments = [screen_id]13 self.sikuli.run_keyword("changeScreenId", arguments)14 def clear_all_highlights_on_screen(self):15 self.sikuli.run_keyword("clearAllHighlights")16 def clear_highlight(self, image_name):17 arguments = [image_name]18 self.sikuli.run_keyword("clearHighlight", arguments)19 def click_on_image(self, image_name, x_offset=0, y_offset=0):20 arguments = [image_name, x_offset, y_offset]21 self.sikuli.run_keyword("click", arguments)22 def click_on_target_image_in_an_area_image(self, target_image_name, area_image_name):23 arguments = [area_image_name, target_image_name]24 self.sikuli.run_keyword("clickIn", arguments)25 def click_on_region(self, x_pos, y_pos, width, height, wait=0, timeout=30):26 coordinates = [x_pos, y_pos, width, height]27 arguments = [coordinates, wait, timeout]28 self.sikuli.run_keyword("clickRegion", arguments)29 def double_click_on_image(self, image_name, x_offset=0, y_offset=0):30 arguments = [image_name, x_offset, y_offset]31 self.sikuli.run_keyword("doubleClick", arguments)32 def double_click_on_target_image_in_an_area_image(self, target_image_name, area_image_name):33 arguments = [area_image_name, target_image_name]34 self.sikuli.run_keyword("doubleClickIn", arguments)35 def drag_source_image_to_target_image(self, source_image_name, target_image_name):36 arguments = [source_image_name, target_image_name]37 self.sikuli.run_keyword("dragAndDrop", arguments)38 def drag_source_image_by_offset(self, source_image_name, x_offset, y_offset):39 arguments = [source_image_name, x_offset, y_offset]40 self.sikuli.run_keyword("dragAndDropByOffset", arguments)41 def image_exists(self, image_name, timeout=30):42 arguments = [image_name, timeout]43 return self.sikuli.run_keyword("exists", arguments)44 def get_current_screen_id(self):45 return self.sikuli.run_keyword("getCurrentScreenId")46 def get_image_coordinates(self, image_name, coordinates=None):47 arguments = [image_name, coordinates]48 return self.sikuli.run_keyword("getImageCoordinates", arguments)49 def get_number_of_screen(self):50 return self.sikuli.run_keyword("getNumberOfScreens")51 def get_text_from_image(self, image_name):52 self._set_ocr_text_read(True)53 arguments = [image_name]54 text = self.sikuli.run_keyword("getText", arguments)55 self._set_ocr_text_read(False)56 return text57 def highlight_image(self, image_name, timeout=3):58 arguments = [image_name, timeout]59 self.sikuli.run_keyword("highlight", arguments)60 def highlight_region(self, x_pos, y_pos, width, height, timeout=3):61 coordinates = [x_pos, y_pos, width, height]62 arguments = [coordinates, timeout]63 self.sikuli.run_keyword("highlightRegion", arguments)64 def input_text_on_image(self, image_name, text=None):65 arguments = [image_name, text]66 self.sikuli.run_keyword("inputText", arguments)67 def mouse_move_to_image(self, image_name):68 arguments = [image_name]69 self.sikuli.run_keyword("mouseMove", arguments)70 def mouse_down(self, *mouse_buttons):71 arguments = [*mouse_buttons]72 self.sikuli.run_keyword("mouseDown", arguments)73 def mouse_up(self, *mouse_buttons):74 arguments = [*mouse_buttons]75 self.sikuli.run_keyword("mouseUp", arguments)76 def mouse_wheel_down(self, image_name, step):77 arguments = [step, image_name]78 self.sikuli.run_keyword("wheelDown", arguments)79 def mouse_wheel_up(self, image_name, step):80 arguments = [step, image_name]81 self.sikuli.run_keyword("wheelUp", arguments)82 def sikuli_open_application(self, app_path):83 arguments = [app_path]84 self.sikuli.run_keyword("openApplication", arguments)85 def sikuli_close_application(self, app_name):86 arguments = [app_name]87 self.sikuli.run_keyword("closeApplication", arguments)88 def paste_text_into_image(self, image_name, text):89 arguments = [image_name, text]90 self.sikuli.run_keyword("pasteText", arguments)91 def press_special_key(self, key):92 arguments = [key]93 self.sikuli.run_keyword("pressSpecialKey", arguments)94 def read_text_from_region(self, region):95 arguments = [region]96 return self.sikuli.run_keyword("readTextFromRegion", arguments)97 def remove_image_path(self, path):98 arguments = [path]99 self.sikuli.run_keyword("removeImagePath", arguments)100 def right_click_on_image(self, image_name):101 arguments = [image_name]102 self.sikuli.run_keyword("rightClick", arguments)103 def right_click_on_target_image_in_area_image(self, target_image_name, area_image_name):104 arguments = [target_image_name, area_image_name]105 self.sikuli.run_keyword("rightClickIn", arguments)106 def screen_should_contain(self, image_name):107 arguments = [image_name]108 return self.sikuli.run_keyword("screenShouldContain", arguments)109 def screen_should_not_contain(self, image_name):110 arguments = [image_name]111 return self.sikuli.run_keyword("screenShouldNotContain", arguments)112 def select_and_capture_region(self, message):113 arguments = [message]114 return self.sikuli.run_keyword("selectRegion", arguments)115 def set_capture_image_directory(self, path):116 arguments = [path]117 self.sikuli.run_keyword("setCaptureFolder", arguments)118 def set_move_mouse_delay(self, delay):119 arguments = [delay]120 self.sikuli.run_keyword("setMoveMouseDelay", arguments)121 def set_slow_motion_delay(self, delay):122 arguments = [delay]123 self.sikuli.run_keyword("setSlowMotionDelay", arguments)124 def set_timeout(self, timeout=30):125 arguments = [timeout]126 self.sikuli.run_keyword("setTimeout", arguments)127 def wait_for_image(self, wanted_image, not_wanted_image, timeout=30):128 arguments = [wanted_image, not_wanted_image, timeout]129 self.sikuli.run_keyword("waitForImage", arguments)130 def wait_for_images(self, wanted_images, not_wanted_images, timeout=30, time_between_check=10):131 arguments = [timeout, time_between_check, wanted_images, not_wanted_images]132 self.sikuli.run_keyword("waitForMultipleImages", arguments)133 def wait_until_screen_contains(self, image_name, timeout=30):134 arguments = [image_name, timeout]135 self.sikuli.run_keyword("waitUntilScreenContain", arguments)136 def wait_until_screen_not_contains(self, image_name, timeout=30):137 arguments = [image_name, timeout]138 self.sikuli.run_keyword("waitUntilScreenNotContain", arguments)139 def capture_region_of_interest(self):140 return self.sikuli.run_keyword("captureRoi")141 def highlight_region_of_interest(self, timeout=3):142 arguments = [timeout]143 self.sikuli.run_keyword("highlightRoi", arguments)144 def reset_region_of_interest(self):145 self.sikuli.run_keyword("resetRoi")146 def set_region_of_interest(self, x_pos, y_pos, width, height, timeout=3):147 coordinates = [x_pos, y_pos, width, height]148 arguments = [coordinates, timeout]149 self.sikuli.run_keyword("setRoi", arguments)150 def _set_ocr_text_read(self, true_or_false):151 arguments = [true_or_false]...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

1# -*- coding: UTF8 -*-2# ***** BEGIN LICENSE BLOCK *****3# Sconspiracy - Copyright (C) IRCAD, 2004-2010.4# Distributed under the terms of the BSD Licence as5# published by the Open Source Initiative. 6# ****** END LICENSE BLOCK ******7import os8import racy9from cppunitproject import CppUnitProject10KEYWORD = CppUnitProject.test_type_var_name11RUN_KEYWORD = CppUnitProject.test_run_var_name12class Plugin(racy.rplugins.Plugin):13 name = "cppunit"14 options = {15 KEYWORD : 'no',16 RUN_KEYWORD : 'no',17 }18 allowed_values = {19 KEYWORD : ['no', 'exec', 'xml', 'shared'] ,20 RUN_KEYWORD : ['no', 'yes']21 }22 commandline_opts = [ KEYWORD , RUN_KEYWORD ]23 commandline_prj_opts = [ KEYWORD , RUN_KEYWORD ]24 descriptions_opts = {25 KEYWORD : 'enable/disable CppUnit Tests' ,26 RUN_KEYWORD : 'Run CppUnit Tests (xml and exec only)',27 }28 additive = True29 def has_additive(self, prj):30 val = prj.get(KEYWORD)31 return val != 'no'32 def get_additive(self, prj):33 test_file = CppUnitProject.get_options_file(prj)34 file_exists = os.path.isfile(test_file)35 res = []36 if file_exists:37 res.append(CppUnitProject( prj = prj ))...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run robotframework-pageobjects automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful