Skip to content

Commit 6a55e07

Browse files
authored
Clear_And_Enter_Text_ADB expects serial of the device (#658)
* Clear_And_Enter_Text_ADB expects serial of the device UI_Automator2 latest version requires int instead of float * Fix swipe duration calculation in BuiltInFunctions.py
1 parent 7ef2a94 commit 6a55e07

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Framework/Built_In_Automation/Mobile/CrossPlatform/Appium/BuiltInFunctions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,8 @@ def Clear_And_Enter_Text_ADB(data_set, serial=""):
32583258

32593259
if serial != "":
32603260
serial = "-s %s" % serial # Prepare serial number with command line switch
3261+
else:
3262+
serial = f"-s {appium_details[device_id]['serial']}"
32613263
# deleting existing text by going to end of line and clicking delete multiple times
32623264
subprocess.check_output(
32633265
"adb %s shell input keyevent 123" % (serial),
@@ -5435,7 +5437,7 @@ def swipe_appium(data_set):
54355437
"Calculated Coordinate: (%s,%s) to (%s,%s)" % (x1, y1, x2, y2), 1)
54365438
i = 0
54375439
while i < max_try:
5438-
appium_driver.swipe(x1, y1, x2, y2, duration * 1000) # duration seconds to milliseconds
5440+
appium_driver.swipe(x1, y1, x2, y2, int(duration) * 1000) # duration seconds to milliseconds
54395441
i = i+1
54405442
return "passed"
54415443

@@ -5560,7 +5562,7 @@ def scroll_to_element(data_set):
55605562
if Element != 'zeuz_failed':
55615563
CommonUtil.ExecLog(sModuleInfo, "Scrolled to the desired element successfully.", 1)
55625564
return "passed"
5563-
appium_driver.swipe(x1, y1, x2, y2, duration * 1000) # duration seconds to milliseconds
5565+
appium_driver.swipe(x1, y1, x2, y2, int(duration) * 1000) # duration seconds to milliseconds
55645566
i = i+1
55655567
CommonUtil.ExecLog(sModuleInfo, "Scrolled %d times.Couldn't find the element." % max_try, 3)
55665568
return "zeuz_failed"

0 commit comments

Comments
 (0)