You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Above: Actual demo of [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) running on [xkcd.com](http://xkcd.com/353/))
52
+
(Above: Actual demo of [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) running on [xkcd.com](https://xkcd.com/353/))
53
53
54
54
There are many more examples to try out from the [SeleniumBase/examples](https://github.com/seleniumbase/SeleniumBase/blob/master/examples) directory, which you can run easily if you clone SeleniumBase.
55
55
@@ -181,18 +181,18 @@ from seleniumbase import BaseCase
181
181
classMyTestClass(BaseCase):
182
182
183
183
deftest_basic(self):
184
-
self.open('http://xkcd.com/353/')
184
+
self.open('https://xkcd.com/353/')
185
185
self.assert_element('img[alt="Python"]')
186
186
self.click('a[rel="license"]')
187
187
self.assert_text('free to copy', 'div center')
188
-
self.open("http://xkcd.com/1481/")
188
+
self.open("https://xkcd.com/1481/")
189
189
title =self.get_attribute("#comic img", "title")
190
190
self.assertTrue("86,400 seconds per day"in title)
191
191
self.click('link=Blag')
192
192
self.assert_text('The blag of the webcomic', 'h2')
193
193
self.update_text('input#s', 'Robots!\n')
194
194
self.assert_text('Hooray robots!', '#content')
195
-
self.open('http://xkcd.com/1319/')
195
+
self.open('https://xkcd.com/1319/')
196
196
self.assert_text('Automation', 'div#ctitle')
197
197
```
198
198
(<i>By default, [CSS Selectors](https://www.w3schools.com/cssref/css_selectors.asp) are used for finding page elements.</i>)
@@ -393,7 +393,7 @@ from seleniumbase import BaseCase
(In general, you'll want to use the SeleniumBase versions of methods when available.)
687
687
688
+
#### Retry Failing Tests Automatically
689
+
690
+
You can use ``--reruns #`` to retry failing tests that many times. Use ``--reruns-delay #`` to wait that many seconds between retries. Example:
691
+
```
692
+
pytest --reruns 5 --reruns-delay 1
693
+
```
694
+
695
+
Additionally, you can use the ``@retry_on_exception()`` decorator to specifically retry failing methods. (First import: ``from seleniumbase import decorators``) To learn more about SeleniumBase decorators, [click here](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/common).
696
+
688
697
#### Checking Email:
689
698
Let's say you have a test that sends an email, and now you want to check that the email was received:
(``name`` is optional, needed only if you were creating multiple tours at once. ``filename`` is the name of the file to save the Javascript to.) Once you've exported your tour, you can use it outside of SeleniumBase. You can even copy the tour's Javascript code to the Console of your web browser to play the tour from there (you need to be on the correct web page for it to work).
0 commit comments