No keyword to swipe delete for iOS
Trying to delete phone book contact, which require swipe to left and delete.
Used Swipe and swipe by percent seems both doesn't worked.
Is there a way to test delete on iOS?
def Hide_cuirte(cuirte):
platformName=BuiltIn().get_variable_value("${current_device.platformName}")
cuirte_size = BuiltIn().run_keyword("get element size", cuirte)
cuirte_position = BuiltIn().run_keyword("get element location", cuirte)
start_x = cuirte_size["width"]+cuirte_position["x"]
start_y = cuirte_size["height"]/2+cuirte_position["y"]
ofset_x = -cuirte_size["width"]
ofset_y = 0
BuiltIn().log("startX "+str(start_x)+" ofsetX "+str(ofset_x)+" startY "+str(start_y)+" ofsetY "+str(ofset_y))
if platformName=="iOS":
BuiltIn().run_keyword("Swipe",start_x,start_y,ofset_x,ofset_y,0)
else:
BuiltIn().run_keyword("Swipe",start_x,start_y,start_x+ofset_x,start_y+ofset_y)
I develop this function with python. The cuirte argument is the item locator you want to delete. The swipe is not the for iOS (ofsetX) and Android (endX).
Already figured it out. Swipe with coordinates work as charm. No need to write anything in python and call with RFramework
Just use Swipe XX YY XX YY Click Element ${delete}
@SamyQAZ, There is problems with this coordinates swipe. If you have to test few devices with different size screen, this swipe doesn' t work all the time but just with the devices which have the good resolution. I wrote this function to adapt swipe for all the resolutions. It is based on element reference instead of coordinates reference.
@lolotoms Thanks, i will try it. Hope it helps
Please check new execute_script refer to #363