自动化主要的就是识别对象,可以在网上搜到各种各样的方法,自行百度。下面仅附上一个简单的例子。

环境搭建参考如下链接:

https://www.cnblogs.com/hepeilinnow/p/10178450.html

代码实现:

#!/usr/bin/env python
# -*- coding:utf-8 -*- from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys driver = webdriver.Firefox() # 登陆portal
driver.get("http://10.84.3.73/portal/home")
driver.maximize_window() time.sleep(1)
driver.find_element_by_id("email").send_keys("admin1")
time.sleep(1)
driver.find_element_by_id("password").send_keys("keda8888") time.sleep(1)
driver.find_element_by_id("remember").click()
driver.find_element_by_id("login-submit").click() #进入会议管理系统
time.sleep(1)
driver.find_element_by_class_name("module.cmc.show").click()
time.sleep(1)
driver.get("http://10.84.3.73/meeting/mcc/manager/49") #邀请终端1,若多个终端可复用
driver.find_element_by_class_name("addMtBtn").click()
driver.find_element_by_class_name("search_input").send_keys("0512110000400")
time.sleep(1)
driver.find_element_by_class_name("search_input").send_keys(Keys.ENTER)
time.sleep(1)
driver.find_element_by_id("orgTree_4_span").click()
driver.find_element_by_css_selector("[class='show_call_type call_type']").click()
driver.find_element_by_css_selector("[class='call_type_video call_type']").click()
time.sleep(1)
driver.find_element_by_css_selector("[class='mt_name mt_ellipsis']").click()
driver.find_element_by_css_selector("[class='operate close right']").click()
driver.find_element_by_css_selector("[class='self_rate']").clear()
driver.find_element_by_css_selector("[class='self_rate']").send_keys(512)
driver.find_element_by_css_selector("[class='kd-btn']").click()
time.sleep(1)
driver.find_element_by_css_selector("[class='btn
ok']").click() #关闭浏览器
driver.quit()

  

python环境通过selenium实现自动化web登陆及终端邀请的更多相关文章

  1. python环境配置selenium与IE、Chrome、Firefox、PhantomJS

    安装.升级selenium pip install -U selenium 下载对应平台最新版的browser driver chrome: http://chromedriver.storage.g ...

  2. python环境安装selenium和手动下载安装selenium的方法

    方法1:cmd环境下,用pip install selenium 可能会很慢 方法2:下载selenium安装包手动安装 下载地址:https://pypi.org/project/selenium/ ...

  3. 篇5 python自动化测试应用-Selenium环境篇

    篇5                            python自动化测试应用-Selenium环境篇 --lamecho 1.1概要 大家好!我是lamecho(辣么丑),从本篇开始我将开始 ...

  4. mac下selenium+python环境搭建

    selenium2+python的环境搭建主要需要python和selenium 1.python mac下自带了python,可以查看版本.当然可以选择安装其它版本的python. 2.seleni ...

  5. Python3 Selenium自动化web测试 ==> 第一节 起始点之Python单元测试框架 unittest

    前置步骤 Python版本:3.6.4 selenium版本:3.11.0 >>> import selenium >>> help(selenium) IDE:P ...

  6. 搭建selenium + Python环境的总结:

    安装Python+Selenium 写博客是一个不错的选择,首先,是担心自己忘掉,其次,可以供大家做一个参考: 其实,这是自己第一次搭建Python环境(之前用了一周的Idle),还是比较容易的吧: ...

  7. python selenium与自动化

    大学是学习过java,但是工作中没用,忘完了,而且哪怕以后有了机会,就是很不愿意去学这个语言,开始喜欢上了c#,但是随着学的升入,感觉.net太庞大了,要学习那么多,总感觉我学这个要做什么,感觉要做的 ...

  8. python+selenium简易自动化框架,包含生成测试报告以及发送结果至Email

    Selenium+python环境搭建见虫师的pdf文档,非常详尽 简易框架: 1.文件目录:

  9. Selenium WebDriver + Python 环境配置

    1.   下载必要工具及安装包 1.1.[Python开发环境] 下载并安装Python 2.7.x版本(当前支持2.x版本,不要下载最新的3.X的版本因为python3并非完全兼容python2) ...

随机推荐

  1. php is_callable()与method_exists()函数

    总结就是 method_exists()检查方法是否存在 is_callable()是否存在并可在当前作用域是否可调用

  2. wfst讲解

    一.比较好的博客 1.0 官方网站 1.1 语音识别解码器(1)—自动机与半环 1.2 走进语音识别中的WFST 1.3Kaldi WFST 构图 学习 二.比较好的paper 三.开源项目 3.1 ...

  3. [LuoguP2158][SDOI2008]仪仗队

    [LuoguP2158][SDOI2008]仪仗队(Link) 现在你有一个\(N \times N\)的矩阵,求你站在\((1,1)\)点能看到的点的总数. 很简洁的题面. 这道题看起来很难,但是稍 ...

  4. js实现限制上传文件大小

    <html> <head> <script type="text/javascript"> var isIE = /msie/i.test(na ...

  5. C# 中的#if、#elif、#else、#endif等条件编译符号 (转载)

    这些是C#中的条件编译符号.这些指令我在项目中遇到过,查过网络,问过人(当然,既不认识大牛,也不认识小牛,所以没什么收获).今天翻看一本资料,有提到这个方面的东西,所以写下来和能看到这篇文章的人一起学 ...

  6. ORA-10485: Real-Time Query cannot be enabled while applying migration redo

    情景:利用Dataguard滚动方式升级数据库后,备库应用redo报错:ORA-10485 MRP0: Background Media Recovery terminated with error ...

  7. iOS 百度地图判断用户是否拖动地图的检测方法

    前言:百度地图API并没有提供移动地图时的回调接口 实现:通过判断当前地图的中心位置是否为用户位置来判断,代码如下 -(void)mapView:(BMKMapView *)mapView regio ...

  8. js随笔--关于数组

    1.split()将一个字符串分割成字符串数组 stringObject.split(separator,howmany) separator:必需,字符串或正则表达式,从该参数指定的地方分割stri ...

  9. XML第一次简单入门(Lab分析)

    In this tutorial you will create a well-formed and verified XML file. Consider the XML document belo ...

  10. 偏前端 - ios下position:fixed失效的问题解决

    如图,考虑到用户体验的问题,一般页面的下方提交按钮都会随着固定在页面上,方便用户点击. 有些人肯定就说了,这还不简单,position:fixed: 但是在ios这个坑货系统上这个position:f ...