当前位置: 首页 > news >正文

广州 网站制作 网站推广wordpress图片被强制放大

广州 网站制作 网站推广,wordpress图片被强制放大,网站策划书包括哪些内容?,上海建工一建集团有限公司1.简介 这一篇宏哥主要介绍webdriver在IE、Chrome和Firefox三个浏览器上处理不信任证书的情况#xff0c;我们知道#xff0c;有些网站打开是弹窗#xff0c;SSL证书不可信任#xff0c;但是你可以点击高级选项#xff0c;继续打开不安全的链接。举例来说#xff0c;想必…1.简介 这一篇宏哥主要介绍webdriver在IE、Chrome和Firefox三个浏览器上处理不信任证书的情况我们知道有些网站打开是弹窗SSL证书不可信任但是你可以点击高级选项继续打开不安全的链接。举例来说想必大家都应该用过前几年的12306网站购票点击新版购票是不是会出现如下的界面。宏哥又找了一个https的页面如下图所示 2.三种浏览器如何处理不受信任的证书 三种浏览器访问网页弹出证书不信任需要点击下信任继续访问才行多为访问https的网页。那么我们在做自动化测试的时候如何跳过这一步骤直接访问到我们需要的页面了这个就是宏哥主要分享和讲解的如何在三大浏览器跳过这一步骤。 3.IE浏览器 3.1代码设计 3.2参考代码 package lessons;import org.openqa.selenium.WebDriver; import org.openqa.selenium.ie.InternetExplorerDriver;/*** author 北京-宏哥**《手把手教你》系列技巧篇四十三-java selenium自动化测试-处理https 安全问题或者非信任站点-上篇详解教程** 2021年11月11日*/public class TestHttps {public static void main(String[] args) throws Exception {// Set the driver pathSystem.setProperty(webdriver.ie.driver, .\\Tools\\IEDriverServer.exe); WebDriver driver new InternetExplorerDriver();Thread.sleep(1000);driver.manage().window().maximize();driver.get(https://www.21xrx.com/);Thread.sleep(2000);String js javascript:document.getElementById(overridelink).click();;//To click on Continue to this website (not recommended). link to load original website.//driver.navigate().to(javascript:document.getElementById(overridelink).click());driver.get(js);//JavascriptExecutor jsExecutor (JavascriptExecutor) driver;//jsExecutor.executeScript(js);System.out.println( 嘿嘿宏哥你已经成功跳过证书信任步骤啦);}} 3.3运行代码 1.运行代码右键Run AS-Java Appliance控制台输出如下图所示 2.运行代码后电脑端的浏览器的动作如下小视频所示 4.Firefox浏览器 4.1代码设计 4.2参考代码 package lessons;import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxProfile;/*** author 北京-宏哥**《手把手教你》系列技巧篇四十三-java selenium自动化测试-处理https 安全问题或者非信任站点详解教程** 2021年11月11日*/public class TestHttps {public static void main(String[] args) throws Exception {System.setProperty(webdriver.gecko.driver, .\\Tools\\geckodriver.exe); // 创建 firefox profileFirefoxProfile profile new FirefoxProfile();// 把这项值设置为True,就是接受不可信任的证书profile.setAcceptUntrustedCertificates(true);FirefoxOptions firefoxOptions new FirefoxOptions(); firefoxOptions.setProfile(profile); // 打开一个带上门设置好profile的火狐浏览器WebDriver driver new FirefoxDriver(firefoxOptions);//driver.setProfile(profile);driver.manage().window().maximize();driver.get(https://www.21xrx.com/);System.out.println( 嘿嘿宏哥你已经成功跳过证书信任步骤啦);}} 4.3运行代码 1.运行代码右键Run AS-Java Appliance控制台输出如下图所示 2.运行代码后电脑端的浏览器的动作如下小视频所示 5.小结 5.1IE浏览器遇到问题及解决办法 1.运行IE浏览器报错 Exception in thread main org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. 解决办法 有的小伙伴或者童鞋们可能觉得是版本的问题宏哥第一想法也是这个问题但是又想了想以前可以运行现在连浏览器的启动不了确定不是版本问题而是由其他原因引起的。这是因为没有关闭IE浏览器的保护模式。当运行测试用例后出现类似以下内容的错误 Exception in thread main org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. 应该就是IE浏览器的保护模式未关闭。 在这里可以关闭保护模式。需要注意的是我们访问的站点是哪个区域的就要把那个区域的保护模式观点。一般来说我都是关全部 而针对IE10及以上版本我们需要关闭“增强保护模式” PS  请注意这里的选项是“重启计算机后生效”而针对IE11我们需要进一步修改注册表。Run-regedit-Enter 如果FeatureControl下没有FEATURE_BFCACHE就以FEATURE_BFCACHE为名new一个key并在其下创建一个DWORD取名为iexplore.exevalue值为0。 另外别忘了一件事情就是IE的缩放选项。请设置缩放选项为100%否则可能无法定位页面元素。 2.IE以前遇到这种问题代码这么写就可以现在就不行了所以宏哥换了一种方式利用前边学习过的JavaScript执行知识进行解决。 package lessons;import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities;/*** author 北京-宏哥**《手把手教你》系列技巧篇四十三-java selenium自动化测试-处理https 安全问题或者非信任站点详解教程** 2021年11月11日*/public class TestHttps {public static void main(String[] args) throws Exception {// Create object of DesiredCapabilities classDesiredCapabilities capDesiredCapabilities.internetExplorer();cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); cap.setJavascriptEnabled(true); // Set the driver pathSystem.setProperty(webdriver.ie.driver, .\\Tools\\IEDriverServer.exe); // Open browser with capabilityWebDriver drivernew InternetExplorerDriver(cap);driver.manage().window().maximize();driver.get(https://www.21xrx.com/);System.out.println( 嘿嘿宏哥你已经成功跳过证书信任步骤啦);}} 3.也许有的小伙伴或者童鞋们发现使用宏哥的代码也不成功那是因为你没有将所有的安全保护模式关闭解决办法参考宏哥知识点1将所有安全保护模式关闭再次运行代码就成功了。 5.2Firefox浏览器遇到问题及解决办法 1.Firefox以前遇到这种问题代码这么写就可以现在就不行了所以宏哥也换了一种方式。 package lessons;import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities;/*** author 北京-宏哥**《手把手教你》系列技巧篇四十三-java selenium自动化测试-处理https 安全问题或者非信任站点详解教程** 2021年11月11日*/public class TestHttps {public static void main(String[] args) throws Exception {System.setProperty(webdriver.gecko.driver, .\\Tools\\geckodriver.exe); // 创建 firefox profileFirefoxProfile profile new FirefoxProfile();// 把这项值设置为True,就是接受不可信任的证书profile.setAcceptUntrustedCertificates(true);// 打开一个带上门设置好profile的火狐浏览器WebDriver driver new FirefoxDriver(profile);driver.manage().window().maximize();driver.get(https://www.21xrx.com/);System.out.println( 嘿嘿宏哥你已经成功跳过证书信任步骤啦);}} 但是代码报错如下图所示 解决办法宏哥换了一种写法查看4.2的参考代码。 每天学习一点今后必成大神- 往期推荐由于跳转参数丢失了所有建议选中要访问的右键在新标签页中打开链接即可访问或者微信搜索: 北京宏哥  公众号提前解锁更多干货。 Appium自动化系列耗时80天打造的从搭建环境到实际应用精品教程测试 Python接口自动化测试教程熬夜87天整理出这一份上万字的超全学习指南 PythonSelenium自动化系列通宵700天从无到有搭建一个自动化测试框架 JavaSelenium自动化系列仿照Python趁热打铁呕心沥血317天搭建价值好几K的自动化测试框架 Jmeter工具从基础-进阶-高级费时2年多整理出这一份全网超详细的入门到精通教程 Fiddler工具从基础-进阶-高级费时100多天吐血整理出这一份全网超详细的入门到精通教程 Pycharm工具基础使用教程
http://www.pierceye.com/news/888250/

相关文章:

  • 怎么将网站设置为首页百度seoo优化软件
  • iis6建设网站浏览wordpress显示在线人数
  • 一键制作单页网站女做受网站
  • 网站推广广告 优帮云开发公司资质哪里查
  • 沈阳网站建设思路做海报的话网站
  • 扬州网站建设suteng崇左网页设计
  • 中文网站模板html做网站 最好的开源cms
  • 个人资料展示网站网站建设网络推广外包服务商
  • 外贸网站建设有什么需要注意的吗网站建设职业发展前景
  • 企业网站建设方案效果版权WordPress
  • 做网站知道访客ip汝州文明建设网站
  • 吴江建设局网站打不开了网站备案信息地址
  • 长沙网站建设优化局域网网站架设软件
  • 重庆企业网站建设解决方案seo关键词怎么优化
  • 信誉好的大良网站建设做的好的ppt下载网站有哪些
  • 栖霞网站定制手机网站图片自适应代码
  • 企业网站管理中心网站海外推广
  • 书店商城网站设计万网虚拟主机做网站教程
  • 文化类网站是不是休闲娱乐类网站wordpress插件 ftp
  • 织梦系统网站吉林省建设安全厅官方网站
  • 网站推广网站关键词排名怎么做建站教程wp
  • 用织梦系统做网站产权网站建设需要掌握什么技术
  • 南宁seo平台费用安徽网站关键词优化排名
  • 李贤威 wordpress甘肃搜索引擎网络优化
  • 网站建设的步骤图片过程9377将军
  • 做彩票网站需要什么服务器wordpress slug
  • 个人空间网站建设太原做网页软件
  • 网站建站方式有哪些wordpress星座主题自适应
  • 如何为公司做网站算命 网站开发
  • 那些做软件的网站十大装潢公司上海