#coding:utf-8
from selenium import webdriver url = "http://demo.testfire.net"
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
driver = webdriver.Chrome(chrome_options=chrome_options,executable_path='/Users/xxxx/driver/chromedriver') driver.get('http://demo.testfire.net')
driver.find_element_by_xpath('//*[@id="_ctl0__ctl0_LoginLink"]').click()
driver.find_element_by_xpath('//*[@id="uid"]').clear()
driver.find_element_by_xpath('//*[@id="uid"]').send_keys('admin')
driver.find_element_by_xpath('//*[@id="passw"]').send_keys('admin')
driver.find_element_by_xpath('//*[@id="login"]/table/tbody/tr[3]/td[2]/input').click() print driver.current_url

  

selenium 调用方法的更多相关文章

  1. Selenium调用Chrome,Firefox,IE

    C#环境下,使用Selenium调用不同的浏览器,可以使用如下方法: IWebDriver driver = null; string Browser =null; if (Browser.Equal ...

  2. selenium 调用JavaScript代码

    selenium 调用JavaScript代码 调用JavaScript方法有两种: execute_script(): 方法解释:是同步方法,用它执行js代码会阻塞主线程执行,直到js代码执行完毕. ...

  3. [No000085]C#反射Demo,通过类名(String)创建类实例,通过方法名(String)调用方法

    using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Sy ...

  4. ThinkPHP跨控制器调用方法

    跨控制器调用方法 1. 先造对象,再调用里面的方法 $sc=new \Home\Controller\IndexController();  用绝对路径找echo $sc->ShuChu(); ...

  5. C# 反射之调用方法谈

    反射的定义 反射提供了描述程序集.模块和类型的对象(Type 类型). 可以使用反射动态创建类型的实例,将类型绑定到现有对象,或从现有对象获取类型并调用其方法或访问其字段和属性. 如果代码中使用了特性 ...

  6. 利用反射调用方法时,处理ref,out参数需要注意的问题(转)

    转自:http://www.68idc.cn/help/buildlang/ask/20150318283817.html 项目中如下的泛型方法,因为要在运行时,动态指定类型参数,所以要利用反射来实现 ...

  7. Struts2 Action下面的Method调用方法

    1. 在struts.xml中加入<constant name="struts.enable.DynamicMethodInvocation" value="tru ...

  8. 完整的分页存储过程以及c#调用方法

    高效分页存储过程 USE [db] GO /****** 对象: StoredProcedure [dbo].[p_Page2005] 脚本日期: // :: ******/ SET ANSI_NUL ...

  9. MySql 存储过程及调用方法

    存储过程实例: DELIMITER $$drop procedure if exists ff $$CREATE /*[DEFINER = { user | CURRENT_USER }]*/ PRO ...

随机推荐

  1. web自动化测试:watir+minitest(四)

    脚本连跑: rake是ruby中的一个构建工具,和make很像.允许用ruby来写rakefile. 我们使用rake以任务的方式来运行我们的脚本集. 新建Rakefile文件,写入如下内容: req ...

  2. Codeforces Round #527 (Div. 3) ABCDEF题解

    Codeforces Round #527 (Div. 3) 题解 题目总链接:https://codeforces.com/contest/1092 A. Uniform String 题意: 输入 ...

  3. css去掉点击连接时所产生的虚线边框技巧兼容符合w3c标准的浏览器

    解决方法: 1.在css中加上outline:none; 代码如下: a.fontnav { text-align:left;color:#555; text-decoration:none; out ...

  4. webservice soapheader验证方法

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  5. error MSB3073 解决方法(转)

    原文转自 http://blog.csdn.net/yangjie569889321/article/details/28488151 最近将VC2002 代码移植到VC2010,出现编译错误:1&g ...

  6. BeeFramework 系列

    http://ilikeido.iteye.com/category/281079 BeeFramework 系列三 MVC篇上 博客分类: Beeframework iphone开发 mvc框架Be ...

  7. (10)ubuntu内核源码树

    ubuntu内核源码树目录: root@ubuntu:/lib/modules/3.13.0-32-generic/build#

  8. Java错误随手记

    一.Eclipse启动时提示: An internal error occurred during: "Initializing Java Tooling" 1.关闭Eclipse ...

  9. python接口自动化6-重定向(Location)【转载】

    本篇转自博客:上海-悠悠 原文地址:http://www.cnblogs.com/yoyoketang/tag/python%E6%8E%A5%E5%8F%A3%E8%87%AA%E5%8A%A8%E ...

  10. ActiveMQ StartUp

    从http://activemq.apache.org/activemq-5132-release.html 下载 解压 从apache-activemq-5.13.2\bin\win64\wrapp ...