Skip to content

Commit 007e372

Browse files
committed
Update the ReadMe
1 parent 4eeaab4 commit 007e372

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ attribute = self.get_attribute("#comic img", "title")
759759
```python
760760
self.wait_for_element_present("div.my_class", timeout=10)
761761
```
762+
762763
(NOTE: You can also use: ``self.assert_element_present(ELEMENT)``)
763764
764765
🔵 Asserting visibility of an element on a page within some number of seconds:
@@ -793,6 +794,7 @@ self.click('a[name*="partial_name"]')
793794
self.assert_text("Make it so!", "div#trek div.picard div.quotes")
794795
self.assert_text("Tea. Earl Grey. Hot.", "div#trek div.picard div.quotes", timeout=3)
795796
```
797+
796798
(NOTE: ``self.find_text(TEXT, ELEMENT)`` and ``self.wait_for_text(TEXT, ELEMENT)`` also do this. For backwards compatibility, older method names were kept, but the default timeout may be different.)
797799
798800
🔵 Asserting Anything:
@@ -893,12 +895,10 @@ You'd know this because the web page would contain something like the following
893895
self.activate_jquery()
894896
```
895897
896-
🔵 Some websites have a restrictive [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) to prevent users from loading jQuery and other external libraries onto their websites. If you need to use jQuery or another JS library on such a website, add ``--disable-csp`` on the command-line.
897-
898898
🔵 Here are some examples of using jQuery in your scripts:
899899
900900
```python
901-
self.execute_script('jQuery, window.scrollTo(0, 600)') # Scrolling the page
901+
self.execute_script("jQuery, window.scrollTo(0, 600)") # Scrolling the page
902902
903903
self.execute_script("jQuery('#annoying-widget').hide()") # Hiding elements on a page
904904
@@ -919,6 +919,8 @@ self.execute_script("return jQuery('textarea')[2].value") # Returns the css "va
919919
920920
(Most of the above commands can be done directly with built-in SeleniumBase methods.)
921921
922+
🔵 Some websites have a restrictive [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) to prevent users from loading jQuery and other external libraries onto their websites. If you need to use jQuery or another JS library on such a website, add ``--disable-csp`` on the command-line.
923+
922924
🔵 In the next example, JavaScript creates a referral button on a page, which is then clicked:
923925
924926
```python
@@ -963,7 +965,7 @@ To flush out all the failed deferred asserts into a single exception, make sure
963965
```python
964966
self.driver.delete_all_cookies()
965967
capabilities = self.driver.capabilities
966-
self.driver.find_elements_by_partial_link_text("GitHub")
968+
self.driver.find_elements("partial link text", "GitHub")
967969
```
968970
969971
(In general, you'll want to use the SeleniumBase versions of methods when available.)

0 commit comments

Comments
 (0)