robot framework + selenium 如何处理此类的下拉框 如何选中下拉框里的值

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了robot framework + selenium 如何处理此类的下拉框 如何选中下拉框里的值相关的知识,希望对你有一定的参考价值。

参考技术A Selenium封装了Select类专门处理下拉框。定义了通过下标,通过文本,通过值等方法选择相对于的项。robot framework + selenium 如何处理此类的下拉框 如何选中下拉框里的值

Robot Framework应用——Mac环境下Robot Framework的安装及简单实用

转载请注明出处:http://blog.csdn.net/dongdong9223/article/details/116591032
本文出自【我是干勾鱼的博客

下载robotframework

$ pip install robotframework
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting robotframework
  Downloading robotframework-4.0.1-py2.py3-none-any.whl (655 kB)
     |████████████████████████████████| 655 kB 15 kB/s 
Installing collected packages: robotframework
Successfully installed robotframework-4.0.1

下载docutils

$ pip install docutils
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting docutils
  Downloading docutils-0.17.1-py2.py3-none-any.whl (575 kB)
     |████████████████████████████████| 575 kB 17 kB/s 
Installing collected packages: docutils
Successfully installed docutils-0.17.1

查看robot版本

$ robot --version
Robot Framework 4.0.1 (Python 2.7.10 on darwin)

下载robotframework-ride

$ pip install robotframework-ride
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting robotframework-ride
  Downloading robotframework-ride-1.7.4.2.tar.gz (846 kB)
     |████████████████████████████████| 846 kB 1.9 MB/s 
Collecting wxPython<=4.0.7.post2
  Downloading wxPython-4.0.7.post2-cp27-cp27m-macosx_10_9_x86_64.whl (16.9 MB)
     |████████████████████████████████| 16.9 MB 543 kB/s 
Collecting PyPubSub
  Downloading PyPubSub-3.3.0.zip (87 kB)
     |████████████████████████████████| 87 kB 2.0 MB/s 
Collecting Pygments
  Downloading Pygments-2.5.2-py2.py3-none-any.whl (896 kB)
     |████████████████████████████████| 896 kB 1.2 MB/s 
Collecting numpy<1.17; python_version <= "2.7"
  Downloading numpy-1.16.6-cp27-cp27m-macosx_10_9_x86_64.whl (13.9 MB)
     |████████████████████████████████| 13.9 MB 2.6 MB/s 
Collecting pillow
  Downloading Pillow-6.2.2-cp27-cp27m-macosx_10_6_intel.whl (3.9 MB)
     |████████████████████████████████| 3.9 MB 2.4 MB/s 
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: robotframework-ride, PyPubSub
  Building wheel for robotframework-ride (setup.py) ... done
  Created wheel for robotframework-ride: filename=robotframework_ride-1.7.4.2-py2-none-any.whl size=950980 sha256=0f6731366cd527a42d814ce37e9e38c5168270a6c5ffdc09760eac832d5064fd
  Stored in directory: /Users/yuhaidong/Library/Caches/pip/wheels/94/e1/c4/dc60488f661a4037adf76d39a490e74950e16919be1ed49d75
  Building wheel for PyPubSub (setup.py) ... done
  Created wheel for PyPubSub: filename=PyPubSub-3.3.0-py2-none-any.whl size=80830 sha256=24fc86e451775032cf302304bb6e618515919ba5923b1a1c1956745e23cbd11d
  Stored in directory: /Users/yuhaidong/Library/Caches/pip/wheels/7c/fb/b6/1728423876af6e29b6a8971bf8a5f03b34c890e03489accb12
Successfully built robotframework-ride PyPubSub
Installing collected packages: numpy, pillow, six, wxPython, PyPubSub, Pygments, robotframework-ride
Successfully installed PyPubSub-3.3.0 Pygments-2.5.2 numpy-1.16.6 pillow-6.2.2 robotframework-ride-1.7.4.2 six-1.16.0 wxPython-4.0.7.post2

下载robotframework-selenium2library

$ pip install robotframework-selenium2library
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting robotframework-selenium2library
  Downloading robotframework_selenium2library-3.0.0-py2.py3-none-any.whl (6.2 kB)
Collecting robotframework-seleniumlibrary>=3.0.0
  Downloading robotframework_seleniumlibrary-4.5.0-py2.py3-none-any.whl (89 kB)
     |████████████████████████████████| 89 kB 570 kB/s 
Collecting robotframework-pythonlibcore>=2.1.0
  Downloading robotframework_pythonlibcore-2.2.1-py2.py3-none-any.whl (10 kB)
Collecting selenium>=3.141.0
  Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)
     |████████████████████████████████| 904 kB 1.7 MB/s 
Requirement already satisfied: robotframework>=3.1.2 in /Users/yuhaidong/py_virtualenv/rpa/lib/python2.7/site-packages (from robotframework-seleniumlibrary>=3.0.0->robotframework-selenium2library) (4.0.1)
Collecting urllib3
  Downloading urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
     |████████████████████████████████| 153 kB 2.8 MB/s 
Installing collected packages: robotframework-pythonlibcore, urllib3, selenium, robotframework-seleniumlibrary, robotframework-selenium2library
Successfully installed robotframework-pythonlibcore-2.2.1 robotframework-selenium2library-3.0.0 robotframework-seleniumlibrary-4.5.0 selenium-3.141.0 urllib3-1.26.4

以上是关于robot framework + selenium 如何处理此类的下拉框 如何选中下拉框里的值的主要内容,如果未能解决你的问题,请参考以下文章

Robot Framework重点

Robot Framework - 从带有参数的其他 *.robot 脚本调用 *.robot 脚本

用Python写Robot Framework测试

mac环境下搭建Robot framework

robot framework数据库操作

Python3 Robot Framework测试框架