Skip to content

Commit b5b0d9e

Browse files
authored
Merge pull request #986 from seleniumbase/recorder-mode-updates
Make improvements to "Recorder Mode"
2 parents 645ea6b + 1ab6e88 commit b5b0d9e

File tree

13 files changed

+105
-17
lines changed

13 files changed

+105
-17
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,23 @@
2727
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">🧙‍♂️ Scripts</a> |
2828
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">🖥️ CLI</a> |
2929
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Mobile</a> |
30-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/js_package_manager.md">🕹️ JSManager</a>
30+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/visual_testing/ReadMe.md">🖼️ VisualTest</a>
3131
<br />
3232
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📚 API</a> |
3333
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📊 Reports</a> |
34-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">🔴 Recorder</a> |
3534
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">🔠 Syntaxes</a> |
35+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">🔴 Recorder</a> |
3636
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md">🌐 Grid</a> |
3737
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md">🗾 Locale</a> |
38-
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Boilerplate</a>
38+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/js_package_manager.md">🕹️ JSManager</a>
3939
<br />
4040
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/github/workflows/ReadMe.md">🤖 CI</a> |
4141
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/ReadMe.md">🎞️ Present</a> |
42+
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Boilerplate</a> |
4243
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/translations.md">🌏 Translate</a> |
43-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/dialog_boxes/ReadMe.md">🛂 DialogBox</a> |
44-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">🗺️ Tours</a> |
44+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">🗺️ Tour</a> |
4545
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">📶 Charts</a> |
46-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/visual_testing/ReadMe.md">🖼️ VisualTest</a>
46+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/dialog_boxes/ReadMe.md">🛂 DialogBox</a>
4747
</p>
4848

4949
<p align="left">

docs/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
regex>=2021.8.27
2-
tqdm>=4.62.2
2+
tqdm>=4.62.3
33
livereload==2.6.3;python_version>="3.6"
44
joblib==1.0.1;python_version>="3.6"
55
Markdown==3.3.4;python_version>="3.6"
@@ -20,8 +20,8 @@ lunr==0.6.0;python_version>="3.6"
2020
nltk==3.6.3;python_version>="3.6"
2121
watchdog==2.1.5;python_version>="3.6"
2222
mkdocs==1.2.2;python_version>="3.6"
23-
mkdocs-material==7.1.3;python_version>="3.6"
23+
mkdocs-material==7.2.8;python_version>="3.6"
2424
mkdocs-exclude-search==0.5.2;python_version>="3.6"
2525
mkdocs-simple-hooks==0.1.3
2626
mkdocs-material-extensions==1.0.3;python_version>="3.6"
27-
mkdocs-minify-plugin==0.4.0
27+
mkdocs-minify-plugin==0.4.1

examples/test_iframes.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from seleniumbase import BaseCase
2+
3+
4+
class FrameTests(BaseCase):
5+
def test_iframe_basics(self):
6+
self.open(
7+
"https://www.w3schools.com/html/tryit.asp"
8+
"?filename=tryhtml_iframe_height_width_css"
9+
)
10+
self.ad_block() # Reduce noise during automation
11+
self.switch_to_frame("iframeResult") # Enter the iFrame
12+
self.assert_text("HTML Iframes", "h2")
13+
self.switch_to_frame('[title*="Iframe"]') # Enter iFrame inside iFrame
14+
self.assert_text("This page is displayed in an iframe", "h1")
15+
self.switch_to_default_content() # Exit all iFrames
16+
self.switch_to_frame("iframeResult") # Go back inside 1st iFrame
17+
self.highlight('iframe[title="Iframe Example"]')
18+
19+
def test_set_content_to_frame(self):
20+
self.open(
21+
"https://www.w3schools.com/html/tryit.asp"
22+
"?filename=tryhtml_iframe_height_width_css"
23+
)
24+
self.set_content_to_frame("iframeResult")
25+
self.highlight('iframe[title="Iframe Example"]', loops=8)

examples/upload_file_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ def test_file_upload_button(self):
1010
"https://www.w3schools.com/jsref/tryit.asp"
1111
"?filename=tryjsref_fileupload_get"
1212
)
13-
self.ad_block()
14-
self.switch_to_frame("iframeResult")
13+
self.set_content_to_frame("iframeResult")
1514
zoom_in = 'input[type="file"]{zoom: 1.6;-moz-transform: scale(1.6);}'
1615
self.add_css_style(zoom_in)
1716
self.highlight('input[type="file"]')

help_docs/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<a href="https://seleniumbase.io/help_docs/recorder_mode.md">🔴 Recorder</a> |
3333
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js">🏃 NodeRunner</a>
3434
<br />
35-
<a href="https://seleniumbase.io/examples/presenter/ReadMe/">📰 Presenter</a> |
35+
<a href="https://seleniumbase.io/examples/presenter/ReadMe/">🎞️ Presenter</a> |
3636
<a href="https://seleniumbase.io/examples/chart_maker/ReadMe/">📶 ChartMaker</a>
3737
</p>
3838

help_docs/method_summary.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ self.switch_to_frame(frame, timeout=None)
197197

198198
self.switch_to_default_content()
199199

200+
self.set_content_to_frame(frame, timeout=None)
201+
200202
self.open_new_window(switch_to=True)
201203

202204
self.switch_to_window(window, timeout=None)
@@ -303,6 +305,8 @@ self.remove_elements(selector, by=By.CSS_SELECTOR)
303305
self.ad_block()
304306
# Duplicates: self.block_ads()
305307

308+
self.show_file_choosers()
309+
306310
self.get_domain_url(url)
307311

308312
self.get_beautiful_soup(source=None)

help_docs/recorder_mode.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="296">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
1+
[<img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" title="SeleniumBase" width="260">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
22

33
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Recorder Mode</h2>
44

@@ -47,6 +47,8 @@ class RecorderTest(BaseCase):
4747

4848
<p>🔴 The launch of Recorder Mode has brought a new SeleniumBase method along with it: <code>self.open_if_not_url(URL)</code>. This method will open the URL given if the browser is not currently on that page. This is used as a method in recorded scripts when SeleniumBase detects that a click action has already brought the test to the given page. This method not only prevents an extra page load if not needed, but it also lets people know the current page of the browser at that point in the test.</p>
4949

50+
<p>🔴 SeleniumBase <code>1.66.1</code> adds the ability to record changes to <i>"Choose File"</i> <code>input</code> fields. It also adds the <code>self.set_content_to_frame(frame)</code> method, which lets you record actions inside of iframes on pages. Sometimes the <i>"Choose File"</i> input field is hidden on some sites, so <code>self.show_file_choosers()</code> was also added to get around this edge case.
51+
5052
--------
5153

5254
<div>To learn more about SeleniumBase, check out the Docs Site:</div>

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pytest-rerunfailures==9.1.1;python_version>="3.5" and python_version<"3.6"
5858
pytest-rerunfailures==10.2;python_version>="3.6"
5959
pytest-xdist==1.34.0;python_version<"3.5"
6060
pytest-xdist==2.2.1;python_version>="3.5" and python_version<"3.6"
61-
pytest-xdist==2.3.0;python_version>="3.6"
61+
pytest-xdist==2.4.0;python_version>="3.6"
6262
parameterized==0.8.1
6363
sbvirtualdisplay==1.0.0
6464
soupsieve==1.9.6;python_version<"3.5"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "1.66.0"
2+
__version__ = "1.66.1"

seleniumbase/extensions/recorder.zip

32 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)