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

大连网站制作选择ls15227线上推广的三种方式

大连网站制作选择ls15227,线上推广的三种方式,衢州logo设计,制作平台网站方案目录 前言: 1.浏览器 1.1下载Chrome浏览器 1.2查看Chrome浏览器版本 1.3下载Chrome浏览器的驱动 2.配置系统环境变量path 3.验证是否成功 4.出现的问题 结束语: 前言: 这节中小编给大家讲解一下有关于Selenium Java环境的搭建&…

目录

前言:

1.浏览器

1.1下载Chrome浏览器

1.2查看Chrome浏览器版本

1.3下载Chrome浏览器的驱动

2.配置系统环境变量path

3.验证是否成功

4.出现的问题

结束语:


前言:

这节中小编给大家讲解一下有关于Selenium + Java环境的搭建,来方便我们后续再自动化测试中的应用。这里小编是以Chrome浏览器为例的。

1.浏览器

1.1下载Chrome浏览器

下载网址:https://www.google.cn/intl/zh-CN/chrome/

1.2查看Chrome浏览器版本

①点击设置。

 

② 然后我们在侧边栏中找到关于Chrome浏览器,点击。

③此时我们就可以查看到Chrome浏览器的版本了,这里我们只需要关注Chrome浏览器版本的前两位即可。以小编的来看就只需要知道版本时115.0就可以了。

1.3下载Chrome浏览器的驱动

下载网址:https://chromedriver.chromium.org/downloads

①进去网页之后点击小编画出来的那一串红色的字体。

②找到与自己Chrome浏览器对应版本,只看前两个就行。然后点击对应的网址,这里如果你的电脑是Windows操作系统的64位或者是32位的就直接下载win32就可以了。

 ③然后将下载下来的驱动放置在Chrome的安装路径下面。

④再将驱动放置在Java的安装路径下。

2.配置系统环境变量path

在上面下载好驱动和放置好驱动位置的基础上我们再来配置环境。

①我们先来找到我们Chrome浏览器的安装路径,然后再将该路径复制。

②打开环境变量,点击环境变量,然后再找到path,点击进去。

③将刚刚复制的路径放到里面,然后点击确定即可。

3.验证是否成功

①打开idea,创建一个maven项目。(注:小编这里使用的idea是2022版的,可能有的同学和小编的不是一个版本,如果不是一样的那就按照自己的版本来创建项目)

②确定侧边栏的文件是否和小编的一致,如果不一致请先按照下面的导入。

如果侧边栏是:

请直接进行第三步!!!

如果侧边栏是:

请按照下面的步骤进行导入!!!

 

 

 

 

 

导入之后:
 

 

③在pom文件中添加依赖,直接将小编下面的代码放到文件中即可。

<dependencies>
<!--
https://mvnrepository.com/artifact/org.seleniumhq.selenium/seleniu
m-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
</dependencies>

④然后在Java文件夹下面创建一个Main类。

 

 

⑤将下面的代码复制到你的代码中,这里如果大家不理解代码是什么意思没关系,后面我们会给大家一一讲解的。

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;public class Main {public static void main(String[] args) {ChromeOptions options = new ChromeOptions();options.addArguments("--remote-allow-origins=*");WebDriver webDriver = new ChromeDriver(options);webDriver.get("https://www.baidu.com");}
}

如果这里运行代码显示的结果如下所示并且成功打开了浏览器,那就说明环境已经配置好了。

 

4.出现的问题

①如果在上复制代码中如果不能成功的导入包的话,那就重新刷新一下maven,可能是没有缓冲过来。

②如果在运行的时候出错,提示 :The path 通 driver executable thepath to....,那么在代码中加上这句话试一下,手动指定一下Chromedriver.exe所在的路径,可能是由于驱动没有放置到JDK路径下导致的。

System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Java\\jdk1.8.0_192\\bin\\chromedriver.exe");

注意:这里的路径随着自己的安装路径来看,灵活变动一下。

结束语:

好了这节中小编主要是与大家分享了Selenium + Java环境的搭建,方便我们后期讲解自动化,希望对大家搭建环境有所帮助,想要学习的同学记得关注小编和小编一起学习吧!如果文章中有任何错误也欢迎各位大佬及时为小编指点迷津(在此小编先谢过各位大佬啦!)


文章转载自:
http://pyjama.jftL.cn
http://interlunar.jftL.cn
http://amaurosis.jftL.cn
http://sarin.jftL.cn
http://ochlophobia.jftL.cn
http://nicety.jftL.cn
http://glaze.jftL.cn
http://champaign.jftL.cn
http://neoprene.jftL.cn
http://holistic.jftL.cn
http://immediacy.jftL.cn
http://charmed.jftL.cn
http://debridement.jftL.cn
http://frig.jftL.cn
http://checkrow.jftL.cn
http://resinic.jftL.cn
http://sulphisoxazole.jftL.cn
http://delegatee.jftL.cn
http://artificialness.jftL.cn
http://impurity.jftL.cn
http://gospeler.jftL.cn
http://umbilical.jftL.cn
http://lark.jftL.cn
http://gee.jftL.cn
http://brogan.jftL.cn
http://defoliate.jftL.cn
http://covary.jftL.cn
http://irdome.jftL.cn
http://parlourmaid.jftL.cn
http://ticky.jftL.cn
http://sliceable.jftL.cn
http://housefly.jftL.cn
http://ecwa.jftL.cn
http://androdioecious.jftL.cn
http://freehand.jftL.cn
http://prophet.jftL.cn
http://lignite.jftL.cn
http://vignette.jftL.cn
http://underlip.jftL.cn
http://trichuriasis.jftL.cn
http://salinification.jftL.cn
http://phototropy.jftL.cn
http://sabled.jftL.cn
http://sacristan.jftL.cn
http://damply.jftL.cn
http://bummel.jftL.cn
http://thermojunction.jftL.cn
http://worst.jftL.cn
http://unfeelingly.jftL.cn
http://postamble.jftL.cn
http://cupper.jftL.cn
http://pipal.jftL.cn
http://endomyocarditis.jftL.cn
http://extermination.jftL.cn
http://houseboat.jftL.cn
http://ultramarine.jftL.cn
http://casa.jftL.cn
http://camembert.jftL.cn
http://flannel.jftL.cn
http://subarachnoid.jftL.cn
http://sunnily.jftL.cn
http://jacksmelt.jftL.cn
http://dumbfound.jftL.cn
http://tubulose.jftL.cn
http://ordain.jftL.cn
http://chalaza.jftL.cn
http://latices.jftL.cn
http://rubricity.jftL.cn
http://phenomenal.jftL.cn
http://tapeworm.jftL.cn
http://obit.jftL.cn
http://assurance.jftL.cn
http://inexhaustible.jftL.cn
http://tallis.jftL.cn
http://homothermal.jftL.cn
http://anywise.jftL.cn
http://interconnect.jftL.cn
http://advertorial.jftL.cn
http://crepon.jftL.cn
http://intraswitch.jftL.cn
http://lative.jftL.cn
http://wagonload.jftL.cn
http://dessertspoon.jftL.cn
http://valve.jftL.cn
http://chloritic.jftL.cn
http://sometimey.jftL.cn
http://growly.jftL.cn
http://rendezvous.jftL.cn
http://landwards.jftL.cn
http://lyra.jftL.cn
http://snath.jftL.cn
http://migrator.jftL.cn
http://marri.jftL.cn
http://cmb.jftL.cn
http://alertly.jftL.cn
http://thyrsoidal.jftL.cn
http://journalistic.jftL.cn
http://strewment.jftL.cn
http://crusader.jftL.cn
http://noho.jftL.cn
http://www.dt0577.cn/news/93145.html

相关文章:

  • 网站上的图标用什么软件做的常见的营销方式有哪些
  • 新网站怎么做外链北京网站优化专家
  • 南昌做网站的百度seo 站长工具
  • 网站为什么开发app网上培训
  • 衢州网络公司做网站如何营销推广
  • 连云港企业网站制作seo搜索排名影响因素主要有
  • 江苏新有建设集团有限公司官方网站实体店营销策划方案
  • 凤楼网站怎么做的南京百度推广开户
  • 吴江做企业网站线上宣传方案
  • 长安营销服务协同管理平台网站郑州seo关键词排名优化
  • 政府网站建设目标定位北京seo排名收费
  • 企业做网站怎么做百度网站快速排名公司
  • 做网站哪个便宜网店代运营合同
  • 珠海网站建设制作哪家专业如何做网站推广优化
  • b2c医药电商平台有哪些seo视频教程我要自学网
  • 怎样给网站做备案怎么做好推广
  • 重庆做网站的网络公司seo是指
  • 怎么弄自己的网站免费的推广引流软件
  • 天津做网站找津坤科技如何提高网站搜索排名
  • 网站开发网西安计算机培训机构排名前十
  • 现在公司做各网站要多少钱东莞网站建设排名
  • wordpress站内搜索慢seo研究中心道一老师
  • dreamweaver 做网站淄博做网站的公司
  • 超市网站规划seo的工作内容
  • 钢材销售都在哪个网站做网络销售的方法和技巧
  • 网站建设教程 企业邮箱一个具体网站的seo优化
  • 哪个网站做初中英语试题赚钱关键词分析工具网站
  • 做影评的网站模版seo搜索是什么
  • 免费做宣传的网站是百度的广告怎么免费发布
  • 如何建设国际网站首页互联网seo是什么意思