11<meta property =" og:site_name " content =" SeleniumBase " >
22<meta property =" og:title " content =" SeleniumBase: Python Web Automation and E2E Testing " />
33<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 " >
55<meta property =" og:image " content =" https://seleniumbase.github.io/cdn/img/mac_sb_logo_5b.png " />
66<link rel =" icon " href =" https://seleniumbase.github.io/img/logo3b.png " />
77
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 >
99
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 >
1111
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 >
1313
1414<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 >
1515
@@ -960,21 +960,23 @@ self.assert_text("Tea. Earl Grey. Hot.", "div#trek div.picard div.quotes", timeo
960960🔵 Asserting Anything:
961961
962962` ` ` python
963- self.assert_true(myvar1 == something)
963+ self.assert_true(var1 == var2)
964+
965+ self.assert_false(var1 == var2)
964966
965967self.assert_equal(var1, var2)
966968` ` `
967969
968970🔵 Useful Conditional Statements: (with creative examples)
969971
970- * ` ` is_element_visible(selector)` ` (visible on the page)
972+ ❓ ` ` is_element_visible(selector): ` ` (visible on the page)
971973
972974` ` ` python
973975if self.is_element_visible(' div#warning' ):
974976 print(" Red Alert: Something bad might be happening!" )
975977` ` `
976978
977- * ` ` is_element_present(selector)` ` (present in the HTML)
979+ ❓ ` ` is_element_present(selector): ` ` (present in the HTML)
978980
979981` ` ` python
980982if self.is_element_present(' div#top_secret img.tracking_cookie' ):
@@ -984,16 +986,23 @@ else:
984986 self.contact_the_nsa(url=current_url, message=" Dark Zone Found" ) # Not a real SeleniumBase method
985987` ` `
986988
987- Another example:
988-
989989` ` ` python
990990def is_there_a_cloaked_klingon_ship_on_this_page ():
991991 if self.is_element_present(" div.ships div.klingon" ):
992992 return not self.is_element_visible(" div.ships div.klingon" )
993993 return False
994994` ` `
995995
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>
9971006
9981007` ` ` python
9991008def get_mirror_universe_captain_picard_superbowl_ad(superbowl_year):
@@ -1022,6 +1031,15 @@ def get_mirror_universe_captain_picard_superbowl_ad(superbowl_year):
10221031 raise Exception(" Reports of my assimilation are greatly exaggerated." )
10231032` ` `
10241033
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+
10251043🔵 Switching Tabs:
10261044
10271045< 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
11641182</p>
11651183<p><div><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></div></p>
11661184
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>
11681186
11691187<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>
11711189<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>
11731191<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>
11751193</div></p>
11761194
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>
11781196<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