Skip to content

Commit 4289ab4

Browse files
author
Tareq
committed
added check if variable name empty or not
1 parent d047538 commit 4289ab4

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

Framework/Built_In_Automation/Desktop/CrossPlatform/BuiltInFunctions.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,15 +1429,16 @@ def ocr_get_value_with_coordinates(data_set):
14291429
)
14301430
return "zeuz_failed"
14311431

1432-
if (topcord > bottomcord or leftcord > rightcord):
1432+
# check if the variable name is provided or not
1433+
if var_name == "":
14331434
CommonUtil.ExecLog(
1434-
sModuleInfo, "Please insert correct coordinates", 3
1435+
sModuleInfo, "Please provide a variable name to store the extracted value", 3
14351436
)
14361437
return "zeuz_failed"
14371438

1438-
if var_name is None:
1439+
if (topcord > bottomcord or leftcord > rightcord):
14391440
CommonUtil.ExecLog(
1440-
sModuleInfo, "Please provide a variable name to store the extracted value", 3
1441+
sModuleInfo, "Please insert correct coordinates", 3
14411442
)
14421443
return "zeuz_failed"
14431444

@@ -1535,6 +1536,13 @@ def ocr_get_value_with_image(data_set):
15351536
)
15361537
return "zeuz_failed"
15371538

1539+
# check if the variable name is provided or not
1540+
if var_name == "":
1541+
CommonUtil.ExecLog(
1542+
sModuleInfo, "Please provide a variable name to store the extracted value", 3
1543+
)
1544+
return "zeuz_failed"
1545+
15381546
get_bbox_dataset = (
15391547
("image", "element parameter", f"{image_name}"),
15401548
("get bounding box", "desktop action", "coords")
@@ -1612,6 +1620,13 @@ def ocr_get_value_with_text(data_set):
16121620
)
16131621
return "zeuz_failed"
16141622

1623+
# check if the variable name is provided or not
1624+
if var_name == "":
1625+
CommonUtil.ExecLog(
1626+
sModuleInfo, "Please provide a variable name to store the extracted value", 3
1627+
)
1628+
return "zeuz_failed"
1629+
16151630
if reader is None:
16161631
ocr_thread = threading.Thread(target=get_easyocr_reader)
16171632
ocr_thread.start()

0 commit comments

Comments
 (0)