Skip to content

Automate browser based workflows with AI

Code generation improvement for select_option action - use label if value is not present (#3973)

Shuchang Zhengb1e9c76627d1
diff --git a/skyvern/core/script_generations/generate_script.py b/skyvern/core/script_generations/generate_script.py
index d462bfd06..8460e5d5a 100644
--- a/skyvern/core/script_generations/generate_script.py
+++ b/skyvern/core/script_generations/generate_script.py
@@ -335,6 +335,8 @@ def _action_to_stmt(act: dict[str, Any], task: dict[str, Any], assign_to_output:
elif method == "select_option":
option = act.get("option", {})
value = option.get("value")
+ label = option.get("label")
+ value = value or label
if value:
if act.get("field_name"):
option_value = cst.Subscript(