Skip to content

Commit 388cbee

Browse files
authored
Merge pull request #685 from seleniumbase/fix-autofill-issues
Fix autofill issues
2 parents 86feac4 + 6fd2fb0 commit 388cbee

File tree

6 files changed

+38
-19
lines changed

6 files changed

+38
-19
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<img src="https://seleniumbase.io/cdn/img/sb_demo_site.png" alt="SeleniumBase" width="340" />
99
</a></p>
1010
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/">
11-
<img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="332" /></a></p>
11+
<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" alt="SeleniumBase" width="332" /></a></p>
1212
<p align="center">
1313
<b>Automated web testing, 10x faster.</b>
1414
</p>
@@ -24,7 +24,7 @@
2424
</p>
2525

2626
<p>
27-
<b>SeleniumBase</b> is an all-in-one framework for web automation, end-to-end testing, presentations, charts, and website tours.
27+
<b>SeleniumBase</b> is an all-in-one framework for fast & simple browser automation, end-to-end testing, presentations, charts, and website tours.
2828
Tests are run with <b>pytest</b>. Browsers are controlled by <b>WebDriver</b>.
2929
</p>
3030

@@ -34,23 +34,27 @@ Tests are run with <b>pytest</b>. Browsers are controlled by <b>WebDriver</b>.
3434
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🏰 Features</a> |
3535
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">👨‍🏫 Examples</a>
3636
<br />
37-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📖 API</a> |
37+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📚 API</a> |
3838
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📋 Reports</a> |
3939
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Mobile</a> |
4040
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_ide/ReadMe.md">⏺️ Recorder</a>
4141
<br />
4242
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/github/workflows/ReadMe.md">🤖 CI</a> |
4343
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/translations.md">🌎 Translate</a> |
4444
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">🗺️ Tours</a> |
45-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/visual_testing/ReadMe.md">🖼️ VisualTests</a>
46-
<br />
47-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/ReadMe.md">📰 Presenter</a> |
48-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">📊 Chart Maker</a> |
49-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">🛂 MasterQA</a>
45+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/visual_testing/ReadMe.md">🖼️ VisualTest</a>
5046
<br />
5147
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">💻 Console Scripts</a> |
5248
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md">🌐 Grid</a> |
5349
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js">🏃 NodeRunner</a>
50+
<br />
51+
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Boilerplates</a> |
52+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md">🗾 Locales</a> |
53+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/js_package_manager.md">🗄️ PkgManager</a>
54+
<br />
55+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/ReadMe.md">📰 Presenter</a> |
56+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">📊 Chart Maker</a> |
57+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">🛂 MasterQA</a>
5458
</p>
5559

5660
<p align="center"><img src="https://cdn2.hubspot.net/hubfs/100006/images/swag_labs_gif.gif" alt="SeleniumBase" title="SeleniumBase" /></p>
@@ -222,7 +226,7 @@ For a full list of SeleniumBase features, <a href="https://github.com/seleniumba
222226

223227

224228
<a id="detailed_instructions"></a>
225-
<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb.png" title="SeleniumBase" width="290">
229+
<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="290">
226230

227231
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Detailed Instructions:</h2>
228232

@@ -814,7 +818,7 @@ Additionally, you can use the ``@retry_on_exception()`` decorator to specificall
814818
<div><!--not_for_site--><iframe src="https://seleniumbase.io/help_docs/ReadMe/" title="Docs"></iframe></div>
815819
<p><div><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></div></p>
816820

817-
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb.png" title="SeleniumBase" width="290" /></a></div>
821+
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" title="SeleniumBase" width="290" /></a></div>
818822

819823
<div><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" title="SeleniumBase" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases"><img src="https://img.shields.io/github/repo-size/seleniumbase/seleniumbase.svg" title="SeleniumBase" alt="Repo Size" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" title="SeleniumBase" alt="Join the chat!" /></a></div>
820824

examples/ip_cow_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class MyTestClass(BaseCase):
66

77
def test_ip_cow(self):
88
self.open('https://www.ipcow.com/')
9-
ip_data = self.get_text("form table")
9+
ip_data = self.get_text("table tbody")
1010
print("\n\n*** IP and Browser Data: ***")
1111
print(ip_data)
1212
print("\nThe browser will close automatically in 7 seconds...")

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pyopenssl==19.1.0
4545
pygments==2.5.2;python_version<"3.5"
4646
pygments==2.6.1;python_version>="3.5"
4747
traitlets==4.3.3;python_version<"3.7"
48-
traitlets==5.0.3;python_version>="3.7"
48+
traitlets==5.0.4;python_version>="3.7"
4949
prompt-toolkit==1.0.18;python_version<"3.6"
5050
prompt-toolkit==3.0.7;python_version>="3.6"
5151
ipython==5.10.0;python_version<"3.5"
@@ -59,7 +59,7 @@ brython==3.8.10
5959
pyotp==2.4.0
6060
boto==2.49.0
6161
cffi==1.14.2
62-
rich==6.0.0;python_version>="3.6" and python_version<"4.0"
62+
rich==6.1.1;python_version>="3.6" and python_version<"4.0"
6363
flake8==3.7.9;python_version<"3.5"
6464
flake8==3.8.3;python_version>="3.5"
6565
pyflakes==2.1.1;python_version<"3.5"

seleniumbase/core/browser_launcher.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ def _set_chrome_options(
236236
chrome_options.add_argument("--disable-infobars")
237237
chrome_options.add_argument("--disable-save-password-bubble")
238238
chrome_options.add_argument("--disable-single-click-autofill")
239+
chrome_options.add_argument(
240+
"--disable-autofill-keyboard-accessory-view[8]")
239241
chrome_options.add_argument("--disable-translate")
240242
chrome_options.add_argument("--homepage=about:blank")
241243
chrome_options.add_argument("--dns-prefetch-disable")
@@ -300,6 +302,7 @@ def _create_firefox_profile(
300302
profile.set_preference("app.update.auto", False)
301303
profile.set_preference("app.update.enabled", False)
302304
profile.set_preference("app.update.silent", True)
305+
profile.set_preference("browser.formfill.enable", False)
303306
profile.set_preference("browser.privatebrowsing.autostart", True)
304307
profile.set_preference("devtools.errorconsole.enabled", False)
305308
profile.set_preference("dom.webnotifications.enabled", False)
@@ -797,6 +800,8 @@ def get_local_driver(
797800
edge_options.add_argument("--disable-infobars")
798801
edge_options.add_argument("--disable-save-password-bubble")
799802
edge_options.add_argument("--disable-single-click-autofill")
803+
edge_options.add_argument(
804+
"--disable-autofill-keyboard-accessory-view[8]")
800805
edge_options.add_argument("--disable-translate")
801806
if not enable_ws:
802807
edge_options.add_argument("--disable-web-security")

seleniumbase/fixtures/base_case.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ def update_text(self, selector, text, by=By.CSS_SELECTOR,
307307
if not self.demo_mode and not self.slow_mode:
308308
self.__scroll_to_element(element, selector, by)
309309
try:
310-
element.clear()
310+
element.clear() # May need https://stackoverflow.com/a/50691625
311+
backspaces = Keys.BACK_SPACE * 42 # Is the answer to everything
312+
element.send_keys(backspaces) # In case autocomplete keeps text
311313
except (StaleElementReferenceException, ENI_Exception):
312314
self.wait_for_ready_state_complete()
313315
time.sleep(0.06)
@@ -316,9 +318,9 @@ def update_text(self, selector, text, by=By.CSS_SELECTOR,
316318
try:
317319
element.clear()
318320
except Exception:
319-
pass # Clearing the text field first isn't critical
321+
pass # Clearing the text field first might not be necessary
320322
except Exception:
321-
pass # Clearing the text field first isn't critical
323+
pass # Clearing the text field first might not be necessary
322324
self.__demo_mode_pause_if_active(tiny=True)
323325
pre_action_url = self.driver.current_url
324326
if type(text) is int or type(text) is float:
@@ -3428,6 +3430,10 @@ def create_presentation(
34283430
'<html>\n'
34293431
'<head>\n'
34303432
'<meta charset="utf-8">\n'
3433+
'<meta http-equiv="Content-Type" '
3434+
'content="text/html; charset=utf-8">\n'
3435+
'<meta name="viewport" '
3436+
'content="width=device-width, initial-scale=1">\n'
34313437
'<link rel="stylesheet" href="%s">\n'
34323438
'<link rel="stylesheet" href="%s">\n'
34333439
'<style>\n'
@@ -4058,6 +4064,10 @@ def save_chart(self, chart_name=None, filename=None):
40584064
if not filename.endswith('.html'):
40594065
raise Exception('Chart file must end in ".html"!')
40604066
the_html = '<meta charset="utf-8">\n'
4067+
the_html += '<meta http-equiv="Content-Type" '
4068+
the_html += 'content="text/html; charset=utf-8">\n'
4069+
the_html += '<meta name="viewport" '
4070+
the_html += 'content="width=device-width, initial-scale=1">\n'
40614071
for chart_data_point in self._chart_data[chart_name]:
40624072
the_html += chart_data_point
40634073
the_html += (

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
setup(
5656
name='seleniumbase',
57-
version='1.49.3',
57+
version='1.49.4',
5858
description='Web Automation and Test Framework - https://seleniumbase.io',
5959
long_description=long_description,
6060
long_description_content_type='text/markdown',
@@ -137,7 +137,7 @@
137137
'pygments==2.5.2;python_version<"3.5"',
138138
'pygments==2.6.1;python_version>="3.5"',
139139
'traitlets==4.3.3;python_version<"3.7"',
140-
'traitlets==5.0.3;python_version>="3.7"',
140+
'traitlets==5.0.4;python_version>="3.7"',
141141
'ipython==5.10.0;python_version<"3.5"',
142142
'prompt-toolkit==1.0.18;python_version<"3.6"',
143143
'prompt-toolkit==3.0.7;python_version>="3.6"',
@@ -151,7 +151,7 @@
151151
'pyotp==2.4.0',
152152
'boto==2.49.0',
153153
'cffi==1.14.2',
154-
'rich==6.0.0;python_version>="3.6" and python_version<"4.0"',
154+
'rich==6.1.1;python_version>="3.6" and python_version<"4.0"',
155155
'flake8==3.7.9;python_version<"3.5"',
156156
'flake8==3.8.3;python_version>="3.5"',
157157
'pyflakes==2.1.1;python_version<"3.5"',

0 commit comments

Comments
 (0)