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
<div>The SeleniumBase JS Package Manager lets you load any JavaScript library into any website.</div>
6
-
<p><div>Here's an example of loading a website-tour library into a browser while visiting Google:</div></p>
3
+
<div>SeleniumBase's JS Package Manager lets you load JavaScript libraries into any website from a CDN link.</div>
4
+
<p><div>Here's an example of loading a website-tour library into a web browser while visiting Google:</div></p>
7
5
8
-
<imgsrc="https://cdn2.hubspot.net/hubfs/100006/google_tour_3.gif"title="SeleniumBase Tour of Google"><br />
6
+
<imgsrc="https://cdn2.hubspot.net/hubfs/100006/google_tour_3.gif"title="SeleniumBase Tour of Google" /><br />
9
7
10
-
This example from [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py)can be run with <b>pytest</b> from the SeleniumBase ``examples/tour_examples`` folder with the following command after you've cloned and installed [SeleniumBase from GitHub](https://github.com/seleniumbase/SeleniumBase):
8
+
This example, ([google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py) from the SeleniumBase ``examples/tour_examples/`` folder), can be run with ``pytest`` after you've cloned and installed [SeleniumBase from GitHub](https://github.com/seleniumbase/SeleniumBase):
11
9
12
10
```bash
13
11
pytest google_tour.py
14
12
```
15
13
16
-
<div>Website tours are just one way of demonstrating the abilities of the SeleniumBase JS Package Manager.</div>
17
-
<div>Here's the code used for loading JS packages into the web browser with SeleniumBase:</div>
14
+
<div>Since a CDN is used for holding packages, you no longer need to use other package managers such as NPM, Bower, or Yarn.</div>
15
+
<p><div>Here's the Python code for loading JS packages into the web browser with SeleniumBase:</div></p>
18
16
19
17
```python
20
18
self.add_js_link(js_link)
21
19
```
22
20
23
-
This example loads the <ahref="https://introjs.com/">IntroJS</a> JavaScript library:
21
+
<div>This example loads the <ahref="https://introjs.com/">IntroJS</a> JavaScript library:</div>
<div>You can load any JS package this way as long as you know the URL.</div>
30
28
31
-
If you're wondering how SeleniumBase does this, here's the Python code, which uses WebDriver's ``execute_script()`` method to make JavaScript calls after escaping quotes:
29
+
If you're wondering how SeleniumBase does this, here's the full Python code, which uses WebDriver's ``execute_script()`` method for making JS calls after escaping quotes:
<div>Website tours are just one of the many ways of using the SeleniumBase JS Package Manager.</div>
81
+
<p><div>The following example shows the <ahref="https://github.com/craftpip/jquery-confirm">JqueryConfirm</a> package loaded into a website for creating fancy dialog boxes:</div></p>
82
+
83
+
<imgsrc="https://cdn2.hubspot.net/hubfs/100006/images/masterqa6.gif"alt="MasterQA by SeleniumBase"title="MasterQA by SeleniumBase" /><br />
84
+
85
+
Since the libraries are loaded directly from a CDN, such as [CloudFlare's cdnjs](https://cdnjs.com/), there's no need to use NPM, Bower, Yarn, or other package managers to get the packages that you need into the websites that you want.
86
+
82
87
--------
83
88
84
89
<div>To learn more about SeleniumBase, check out the Docs Site:</div>
0 commit comments