Skip to content

Commit 829dc07

Browse files
Merge pull request #569 from AutomationSolutionz/chrome-for-testing-integration
fixed warning related to send_dom_variables
2 parents dfe1145 + 6243d0a commit 829dc07

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Framework/MainDriverApi.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,15 @@ def send_dom_variables():
11771177
})
11781178
except (json.decoder.JSONDecodeError, TypeError):
11791179
try:
1180-
dir_ = { k:str(type(v)) for k,v in [(i, getattr(var_value, i)) for i in dir(var_value) if not i.startswith('__')]}
1180+
dir_ = {}
1181+
for attr_name in dir(var_value):
1182+
if attr_name.startswith('__'):
1183+
continue
1184+
try:
1185+
attr_value = getattr(var_value, attr_name)
1186+
dir_[attr_name] = str(type(attr_value))
1187+
except Exception: # ignore getattr errors
1188+
pass
11811189
variables.append({
11821190
"type": f"non_json: {str(var_value)}",
11831191
"variable_name": var_name,

0 commit comments

Comments
 (0)