51Testing软件测试论坛

标题: selenium 打开需要证书的网页怎么处理 [打印本页]

作者: 15889369825    时间: 2017-1-9 17:55
标题: selenium 打开需要证书的网页怎么处理
公司有个管理平台  需要导入公司特定证书才能使用   现在证书已经导入了  但selenium登录后报地址错误,不安全的链接,这种情况怎么处理

作者: 清晨一缕阳光    时间: 2017-1-10 10:01
可以参考如下方法
http://www.cnblogs.com/lelelong/p/5523444.html
http://blog.csdn.net/qiyueqinglian/article/details/49818117


作者: 李小qq    时间: 2017-1-10 10:24
来学习一下
作者: 15889369825    时间: 2017-1-10 13:59
清晨一缕阳光 发表于 2017-1-10 10:01
可以参考如下方法
http://www.cnblogs.com/lelelong/p/5523444.html
http://blog.csdn.net/qiyueqinglian ...

好的谢谢,去看看
作者: 15889369825    时间: 2017-1-10 14:04
清晨一缕阳光 发表于 2017-1-10 10:01
可以参考如下方法
http://www.cnblogs.com/lelelong/p/5523444.html
http://blog.csdn.net/qiyueqinglian ...

这个好像是java的   没有python的调用方法么,网上没找到
作者: 清晨一缕阳光    时间: 2017-1-10 15:25
15889369825 发表于 2017-1-10 14:04
这个好像是java的   没有python的调用方法么,网上没找到

主要的是理解这个方法,方法是一样的。Python只是和java的写法不一样罢了
作者: 15889369825    时间: 2017-1-10 16:54
清晨一缕阳光 发表于 2017-1-10 15:25
主要的是理解这个方法,方法是一样的。Python只是和java的写法不一样罢了

# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, re

class jfg(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()
        webdriver.FirefoxProfile=("E:\ECLIPSE\ROBOT\jfgou")
        self.driver.maximize_window()
        self.base_url = "https://test1.jfgou.com:8080/"
        self.verificationErrors = []
        self.accept_next_alert = True
   
    def test_123(self):
        driver = self.driver
        driver.get(self.base_url + "/themes/index.html")
        driver.find_element_by_id("username").clear()
        driver.find_element_by_id("username").send_keys("admin")
        driver.find_element_by_id("password").clear()

安装方法加了,好像也没用




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2