Skip to content

Commit 82116af

Browse files
committed
Add "&" as a shortcut for a single-syllable "name" selector
1 parent 54d7804 commit 82116af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

seleniumbase/fixtures/page_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def is_name_selector(selector):
6868
"""
6969
A basic method to determine if a selector is a name selector.
7070
"""
71-
if selector.startswith("name="):
71+
if selector.startswith("name=") or selector.startswith("&"):
7272
return True
7373
return False
7474

@@ -110,7 +110,9 @@ def get_name_from_selector(selector):
110110
A basic method to get the name from a name selector.
111111
"""
112112
if selector.startswith("name="):
113-
return selector.split("name=")[1]
113+
return selector[len("name="):]
114+
if selector.startswith("&"):
115+
return selector[len("&"):]
114116
return selector
115117

116118

0 commit comments

Comments
 (0)