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

环境搭建参考如下链接:

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. sqoop mysql--->hive 报错 (ERROR tool.ImportTool: Import failed: java.io.IOException: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf)

    ERROR tool.ImportTool: Import failed: java.io.IOException: java.lang.ClassNotFoundException: org.apa ...

  2. 【luogu P1850 换教室】 题解

    题目链接:https://www.luogu.org/problemnew/show/P1850 难的不在状态上,难在转移方程. (话说方程写错居然还有84分= =) #include <cst ...

  3. tomcat启动错误org.springframework.beans.factory.CannotLoadBeanClassException的解决

    tomcat启动时一直报这个错误,但是报错的类确实存在. 清空tomcat,更新maven项目,重配tomcat都没有解决. 最后解决办法: Eclipse环境:Project-->clean ...

  4. VMware虚拟机安装Centos7图文教程

    CentOS 是一个工业标准的 Linux 发行版,是红帽企业版 Linux 的衍生版本.你安装完后马上就可以使用,但是为了更好地使用你的系统,你需要进行一些升级.安装新的软件包.配置特定服务和应用程 ...

  5. CentOS 7.0 防火墙操作

    CentOS 7.0默认使用的是firewall作为防火墙,之前版本是使用iptables.所以在CentOS 7执行下面命令是无法查看防火墙状态的. [root@localhost ~]# serv ...

  6. C++练习 | 掷骰子走到第n步的方法数(DFS)

    玩家根据骰子的点数决定步数,骰子点数为1的时候走一步,以此类推.求玩家走到第n步总共有多少种投骰子的方法.输入为一个整数n,输出为投骰子的方法数. #include <iostream> ...

  7. Windows常用shell命令

    一.Windows的Shell命令又是Windows的CMD命令.而cmd命令又是原来MS-DOS系统保留下来 二.Windows Shell命令是基于配置好的Path环境变量,对Shell命令在Pa ...

  8. JanusGraph 图数据库安装小记 ——以 JanusGraph 0.3.0 为例

    由于近期项目中有使用图数据的需求,经过对比,我们选择尝试使用 JanusGraph.本篇小记记录了我们安装 JanusGraph 以及需要一起集成的 Cassandra + Elasticsearch ...

  9. redis-数据类型及命令

    redis五大数据类型:string(字符串),hash(哈希,类似java的Map),list(列表),set(集合),zset(有序集合) 1.redis的键(key) keys 查询数据库中的k ...

  10. Contract Helper

    using System; using Microsoft.Xrm.Sdk; using Microsoft.Crm.Sdk.Messages; using Microsoft.Xrm.Sdk.Que ...