Skip to content

Commit 17d06c7

Browse files
authored
Merge pull request #249 from seleniumbase/converter-tool-upgrade
Update the Selenium IDE script converter tool
2 parents b324f71 + 6a07ce7 commit 17d06c7

File tree

8 files changed

+23
-20
lines changed

8 files changed

+23
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_2h2.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
22

3-
[<img src="https://img.shields.io/pypi/v/seleniumbase.svg" alt="Version" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://img.shields.io/badge/python-2.7,_3.*-22AADD.svg" alt="Python versions" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="http://img.shields.io/badge/license-MIT-22BBCC.svg" alt="MIT License" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers)<br />
3+
[<img src="https://img.shields.io/pypi/v/seleniumbase.svg" alt="Version" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://img.shields.io/badge/python-2.7,_3.x-22AADD.svg" alt="Python versions" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="http://img.shields.io/badge/license-MIT-22BBCC.svg" alt="MIT License" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers)<br />
44

55
A complete framework for web automation, end-to-end testing, and [user-onboarding](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md). SeleniumBase uses [Pytest](https://github.com/pytest-dev/pytest) for running Python scripts, while using [WebDriver](https://www.seleniumhq.org/) for controlling web browsers.
66

@@ -382,7 +382,7 @@ pytest [YOUR_TEST_FILE].py --browser=chrome --with-db_reporting --with-s3_loggin
382382

383383
When the testing_base plugin is used, if there's a test failure, the basic_test_info plugin records test logs, the page_source plugin records the page source of the last web page seen by the test, and the screen_shots plugin records the image of the last page seen by the test where the failure occurred. Make sure you always include testing_base whenever you include a plugin that logs test data. The db_reporting plugin records the status of all tests run into your MySQL DB. The s3_logging plugin uploads basic test info, screenshots, and page source into your S3 storage folder.
384384

385-
To simplify that long run command, you can create a *.cfg file, such as the one provided in the example, and enter your plugins there so that you can run everything by typing:
385+
To simplify that long run command, you can create a ``*.cfg`` file, such as the one provided in the example, and enter your plugins there so that you can run everything by typing:
386386

387387
```
388388
nosetests [YOUR_TEST_FILE].py --config=[MY_CONFIG_FILE].cfg

examples/capabilities/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ A regex parser was built into SeleniumBase to capture all lines from the specifi
4040
``caps['KEY'] = "VALUE"``
4141
(Each pair must be on a separate line. You can interchange single and double quotes.)
4242

43-
You can also swap ``--browser=remote`` with an actual browser, eg ``--browser=chrome``, which will combine the default SeleniumBase desired capabilities with those that were specified in the capabilities file when using ``--cap_file=FILE.py``. Capabilities will override other parameters, so if you set the browser to one thing and the capabilities browser to another, SeleniumBase will use the capabilities browser as the browser. You'll need default SeleniumBase desired capabilities when using a proxy server (not the same as a Selenium Grid server), when downloading files to a desired folder, for disabling some warnings on Chrome, for overriding a website's Content Security Policy on Firefox, and for other reasons.
43+
You can also swap ``--browser=remote`` with an actual browser, eg ``--browser=chrome``, which will combine the default SeleniumBase desired capabilities with those that were specified in the capabilities file when using ``--cap_file=FILE.py``. Capabilities will override other parameters, so if you set the browser to one thing and the capabilities browser to another, SeleniumBase will use the capabilities browser as the browser. You'll need default SeleniumBase desired capabilities when using a proxy server (not the same as a Selenium Grid server), when downloading files to a desired folder, for disabling some warnings on Chrome, for overriding a website's Content Security Policy on Firefox, and for other reasons.

help_docs/install_python_pip_git.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Installation instructions for Python, pip, brew, git, virtualenv, and virtualenvwrapper
22

3-
### [Python 2.7 or 3.*](https://www.python.org/downloads/)
3+
### [Python 2.7 or 3.x](https://www.python.org/downloads/)
44

55
If you're a MAC user, Python should already come preinstalled on your machine. You can use both Python 2.7 or Python 3.6+ with SeleniumBase. If you're on a MAC and have [Homebrew](https://brew.sh/) installed, you can use: ``brew install python3`` to install Python 3. Or you can just get everything from [https://www.python.org/downloads/](https://www.python.org/downloads/).
66

help_docs/mysql_installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ If you're having trouble with Windows mysql-python installation using pip, you c
5757

5858
* Run the command ``pip install FILENAME.whl``
5959

60-
* If pip.exe is not recognized, you may find it in the "Scripts" directory from where python has been installed.
60+
* If pip.exe is not recognized, you may find it in the "Scripts" directory from where python has been installed.

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pip
22
setuptools
3-
ipython
43
six
54
nose
65
ipdb
@@ -9,7 +8,7 @@ unittest2
98
selenium==3.141.0
109
requests==2.20.1
1110
urllib3==1.24.1
12-
pytest>=4.0.0
11+
pytest>=4.0.1
1312
pytest-cov>=2.6.0
1413
pytest-html>=1.19.0
1514
pytest-rerunfailures>=5.0

seleniumbase/console_scripts/ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ test frameworks.
4343
``seleniumbase convert [PYTHON_WEBDRIVER_UNITTEST_FILE]``
4444

4545
* Output:
46-
Converts a Selenium IDE exported WebDriver unittest
47-
file into a SeleniumBase file. Adds _SB to the new
46+
Converts a Selenium IDE exported WebDriver unittest file
47+
into a SeleniumBase file. Adds ``_SB`` to the new
4848
file name while keeping the original file intact.
4949
Works with Katalon Recorder scripts.
5050
See: http://www.katalon.com/automation-recorder

seleniumbase/utilities/selenium_ide/convert_ide.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ def main():
151151
r'''\.click\(\)\s*$''', line)
152152
if data:
153153
whitespace = data.group(1)
154-
selector = '#%s' % data.group(2)
154+
selector = '#%s' % data.group(2).replace('#', '\\#')
155155
selector = selector.replace('[', '\\[').replace(']', '\\]')
156+
selector = selector.replace('.', '\\.')
156157
command = '''%sself.click('%s')''' % (whitespace, selector)
157158
seleniumbase_lines.append(command)
158159
continue
@@ -163,8 +164,9 @@ def main():
163164
r'''\.send_keys\(\"([\S\s]+)\"\)\s*$''', line)
164165
if data:
165166
whitespace = data.group(1)
166-
selector = '#%s' % data.group(2)
167+
selector = '#%s' % data.group(2).replace('#', '\\#')
167168
selector = selector.replace('[', '\\[').replace(']', '\\]')
169+
selector = selector.replace('.', '\\.')
168170
text = data.group(3)
169171
command = '''%sself.update_text('%s', '%s')''' % (
170172
whitespace, selector, text)
@@ -178,8 +180,9 @@ def main():
178180
if data:
179181
uses_keys = True
180182
whitespace = data.group(1)
181-
selector = '#%s' % data.group(2)
183+
selector = '#%s' % data.group(2).replace('#', '\\#')
182184
selector = selector.replace('[', '\\[').replace(']', '\\]')
185+
selector = selector.replace('.', '\\.')
183186
key = 'Keys.%s' % data.group(3)
184187
command = '''%sself.send_keys('%s', %s)''' % (
185188
whitespace, selector, key)
@@ -308,7 +311,7 @@ def main():
308311
whitespace = data.group(1)
309312
selector = '%s' % data.group(2)
310313
visible_text = '%s' % data.group(3)
311-
command = '''%sself.pick_select_option_by_text('%s', '%s')''' % (
314+
command = '''%sself.select_option_by_text('%s', '%s')''' % (
312315
whitespace, selector, visible_text)
313316
if command.count('\\"') == command.count('"'):
314317
command = command.replace('\\"', '"')
@@ -322,9 +325,11 @@ def main():
322325
r'''\"([\S\s]+)\"\)\s*$''', line)
323326
if data:
324327
whitespace = data.group(1)
325-
selector = '#%s' % data.group(2)
328+
selector = '#%s' % data.group(2).replace('#', '\\#')
329+
selector = selector.replace('[', '\\[').replace(']', '\\]')
330+
selector = selector.replace('.', '\\.')
326331
visible_text = '%s' % data.group(3)
327-
command = '''%sself.pick_select_option_by_text('%s', '%s')''' % (
332+
command = '''%sself.select_option_by_text('%s', '%s')''' % (
328333
whitespace, selector, visible_text)
329334
if command.count('\\"') == command.count('"'):
330335
command = command.replace('\\"', '"')
@@ -340,7 +345,7 @@ def main():
340345
whitespace = data.group(1)
341346
selector = '%s' % data.group(2)
342347
visible_text = '%s' % data.group(3)
343-
command = '''%sself.pick_select_option_by_text("%s", '%s')''' % (
348+
command = '''%sself.select_option_by_text("%s", '%s')''' % (
344349
whitespace, selector, visible_text)
345350
if command.count('\\"') == command.count('"'):
346351
command = command.replace('\\"', '"')
@@ -356,7 +361,7 @@ def main():
356361
whitespace = data.group(1)
357362
selector = '[name="%s"]' % data.group(2)
358363
visible_text = '%s' % data.group(3)
359-
command = '''%sself.pick_select_option_by_text('%s', '%s')''' % (
364+
command = '''%sself.select_option_by_text('%s', '%s')''' % (
360365
whitespace, selector, visible_text)
361366
if command.count('\\"') == command.count('"'):
362367
command = command.replace('\\"', '"')

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.17.6',
20+
version='1.17.7',
2121
description='All-in-One Test Automation Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',
@@ -53,7 +53,6 @@
5353
install_requires=[
5454
'pip',
5555
'setuptools',
56-
'ipython',
5756
'six',
5857
'nose',
5958
'ipdb',
@@ -62,7 +61,7 @@
6261
'selenium==3.141.0',
6362
'requests==2.20.1', # Changing this may effect "urllib3"
6463
'urllib3==1.24.1', # Keep this lib in sync with "requests"
65-
'pytest>=4.0.0',
64+
'pytest>=4.0.1',
6665
'pytest-cov>=2.6.0',
6766
'pytest-html>=1.19.0',
6867
'pytest-rerunfailures>=5.0',

0 commit comments

Comments
 (0)