1
1
<meta property =" og:site_name " content =" SeleniumBase " >
2
2
<meta property =" og:title " content =" SeleniumBase: Python Web Automation and E2E Testing " />
3
3
<meta property =" og:description " content =" Fast, easy, and reliable Web/UI testing with Python. " />
4
- <meta property =" og:keywords " content =" Python, pytest, selenium, webdriver, testing, automation, seleniumbase, framework, RPA, behave, BDD, nosetests, dashboard, recorder, reports, gui , screenshots " >
4
+ <meta property =" og:keywords " content =" Python, pytest, selenium, webdriver, testing, automation, seleniumbase, framework, dashboard, recorder, reports, screenshots " >
5
5
<meta property =" og:image " content =" https://seleniumbase.github.io/cdn/img/mac_sb_logo_5b.png " />
6
6
<link rel =" icon " href =" https://seleniumbase.github.io/img/logo3b.png " />
7
7
8
- <h1 > SeleniumBase</ h1 >
8
+ <p align = " center " >< a href = " https://github.com/seleniumbase/ SeleniumBase/ " >< img src = " https://seleniumbase.github.io/cdn/img/sb_logo_p3.png " alt = " SeleniumBase " title = " SeleniumBase " width = " 406 " /></ a ></ p >
9
9
10
- <p align =" center " ><a href = " https://github.com/seleniumbase/SeleniumBase/ " >< img src = " https://seleniumbase.github.io/cdn/img/logo_base_3.png " alt = " SeleniumBase " title = " SeleniumBase " width = " 234 " /></ a ></p >
10
+ <h3 align =" center " ><b >All-in-one Test Automation Framework</ b ></h3 >
11
11
12
- <h3 align =" center " ><b >All-in-one test automation framework </b ></ h3 >
12
+ <h4 align =" center " ><img src = " https://seleniumbase.github.io/cdn/img/python_logo.png " title = " SeleniumBase " width = " 29 " /> < b >For Python enthusiasts and enterprise developers </b > < img src = " https://seleniumbase.github.io/cdn/img/python_logo.png " title = " SeleniumBase " width = " 29 " /></ h4 >
13
13
14
14
<p align =" center " ><a href =" https://pypi.python.org/pypi/seleniumbase " target =" _blank " ><img src =" https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE " alt =" PyPI version " /></a > <a href =" https://github.com/seleniumbase/SeleniumBase/releases " target =" _blank " ><img src =" https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE " alt =" GitHub version " /></a > <a href =" https://seleniumbase.io " ><img src =" https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg " alt =" SeleniumBase Docs " /></a > <a href =" https://github.com/seleniumbase/SeleniumBase/actions " target =" _blank " ><img src =" https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg " alt =" SeleniumBase GitHub Actions " /></a > <a href =" https://gitter.im/seleniumbase/SeleniumBase " target =" _blank " ><img src =" https://badges.gitter.im/seleniumbase/SeleniumBase.svg " alt =" SeleniumBase " /></a ></p >
15
15
@@ -960,21 +960,23 @@ self.assert_text("Tea. Earl Grey. Hot.", "div#trek div.picard div.quotes", timeo
960
960
🔵 Asserting Anything:
961
961
962
962
` ` ` python
963
- self.assert_true(myvar1 == something)
963
+ self.assert_true(var1 == var2)
964
+
965
+ self.assert_false(var1 == var2)
964
966
965
967
self.assert_equal(var1, var2)
966
968
` ` `
967
969
968
970
🔵 Useful Conditional Statements: (with creative examples)
969
971
970
- * ` ` is_element_visible(selector)` ` (visible on the page)
972
+ ❓ ` ` is_element_visible(selector): ` ` (visible on the page)
971
973
972
974
` ` ` python
973
975
if self.is_element_visible(' div#warning' ):
974
976
print(" Red Alert: Something bad might be happening!" )
975
977
` ` `
976
978
977
- * ` ` is_element_present(selector)` ` (present in the HTML)
979
+ ❓ ` ` is_element_present(selector): ` ` (present in the HTML)
978
980
979
981
` ` ` python
980
982
if self.is_element_present(' div#top_secret img.tracking_cookie' ):
@@ -984,16 +986,23 @@ else:
984
986
self.contact_the_nsa(url=current_url, message=" Dark Zone Found" ) # Not a real SeleniumBase method
985
987
` ` `
986
988
987
- Another example:
988
-
989
989
` ` ` python
990
990
def is_there_a_cloaked_klingon_ship_on_this_page ():
991
991
if self.is_element_present(" div.ships div.klingon" ):
992
992
return not self.is_element_visible(" div.ships div.klingon" )
993
993
return False
994
994
` ` `
995
995
996
- * ` ` is_text_visible(text, selector)` ` (text visible on element)
996
+ ❓ ` ` is_text_visible(text, selector):` ` (text visible on element)
997
+
998
+ ` ` ` python
999
+ if self.is_text_visible(" You Shall Not Pass!" , " h1" ):
1000
+ self.open(" https://www.youtube.com/watch?v=3xYXUeSmb-Y" )
1001
+ ` ` `
1002
+
1003
+ < div></div>
1004
+ < details>
1005
+ < summary> ▶️ Click for a longer example of <code>is_text_visible ():< /code></summary>
997
1006
998
1007
` ` ` python
999
1008
def get_mirror_universe_captain_picard_superbowl_ad(superbowl_year):
@@ -1022,6 +1031,15 @@ def get_mirror_universe_captain_picard_superbowl_ad(superbowl_year):
1022
1031
raise Exception(" Reports of my assimilation are greatly exaggerated." )
1023
1032
` ` `
1024
1033
1034
+ < /details>
1035
+
1036
+ ❓ ` ` is_link_text_visible(link_text):` `
1037
+
1038
+ ` ` ` python
1039
+ if self.is_link_text_visible(" Stop! Hammer time!" ):
1040
+ self.click_link(" Stop! Hammer time!" )
1041
+ ` ` `
1042
+
1025
1043
🔵 Switching Tabs:
1026
1044
1027
1045
< p> If your test opens up a new tab/window, you can switch to it. (SeleniumBase automatically switches to new tabs that don' t open to <code>about:blank</code> URLs.)</p>
@@ -1164,15 +1182,15 @@ pytest --reruns=1 --reruns-delay=1
1164
1182
</p>
1165
1183
<p><div><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></div></p>
1166
1184
1167
- <div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/fancy_logo_14.png" title="SeleniumBase" width="200" /></a></div> <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://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" title="SeleniumBase" alt="Join the chat!" /></a></div> <div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg" alt="Tested with SeleniumBase" /></a></div> <div><a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a></div> <div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a></div>
1185
+ <div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/fancy_logo_14.png" title="SeleniumBase" width="220" /></a></div> <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://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" title="SeleniumBase" alt="Join the chat!" /></a></div> <div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg" alt="Tested with SeleniumBase" /></a></div> <div><a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a></div> <div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a></div>
1168
1186
1169
1187
<p><div>
1170
- <span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="40 " /></a></span>
1188
+ <span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="43 " /></a></span>
1171
1189
<span><a href="https://www.facebook.com/SeleniumBase" target="_blank"><img src="https://seleniumbase.github.io/img/social/share_facebook.svg" title="SeleniumBase on Facebook" alt="SeleniumBase on Facebook" width="37" /></a></span>
1172
- <span><a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://seleniumbase.github.io/img/social/share_gitter.svg" title="SeleniumBase on Gitter" alt="SeleniumBase on Gitter" width="32 " /></a></span>
1190
+ <span><a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://seleniumbase.github.io/img/social/share_gitter.svg" title="SeleniumBase on Gitter" alt="SeleniumBase on Gitter" width="35 " /></a></span>
1173
1191
<span><a href="https://instagram.com/seleniumbase" target="_blank"><img src="https://seleniumbase.github.io/img/social/share_instagram.svg" title="SeleniumBase on Instagram" alt="SeleniumBase on Instagram" width="33" /></a></span>
1174
- <span><a href="https://twitter.com/seleniumbase" target="_blank"><img src="https://seleniumbase.github.io/img/social/share_twitter.svg" title="SeleniumBase on Twitter" alt="SeleniumBase on Twitter" width="40 " /></a></span>
1192
+ <span><a href="https://twitter.com/seleniumbase" target="_blank"><img src="https://seleniumbase.github.io/img/social/share_twitter.svg" title="SeleniumBase on Twitter" alt="SeleniumBase on Twitter" width="39 " /></a></span>
1175
1193
</div></p>
1176
1194
1177
- <p><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb .png" alt="SeleniumBase" title="SeleniumBase" width="200 " /></a></p>
1195
+ <p><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_i2 .png" alt="SeleniumBase" title="SeleniumBase" width="240 " /></a></p>
1178
1196
<p><a href="https://www.python.org/downloads/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE&logo=python" title="Supported Python Versions" /></a></p>
0 commit comments