13.4web自动化测试(Selenium3+Java)

一.定义

 用来做web自动化测试的框架.

二.特点

1.支持各种浏览器.

2.支持各种平台(操作系统).

3.支持各种编程语言.

4.有丰富的api.

三.工作原理

四.搭环境

1.对照Chrome浏览器版本号,下载ChromeDriver,配置环境变量,我直接把.exe文件放在了jdk安装路径的bin文件夹下了(jdk配置了环境变量).

2.创建mavem项目,在pom.xml文件中引入Selenium依赖.

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.7.2</version>
</dependency>

3.创建启动类,用百度进行测试.

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");
    }
}

如果正常运行,则环境搭配好了.

五.css选择器

1.id选择器: #id

2.类选择器: .class

3.标签选择器: 标签

4.后代选择器: 父级选择器, 子级选择器.

注意:两种选择器,建议使用CSS选择器,因为效率高.

六.Xpath选择器

1.绝对路径: /html/......(效率低,不常用).

2.相对路径: //......

a.相对路径+索引

//form/span[1]/input

注意: 数组下标从1开始.

b.相对路径+属性值

//input[@class="s_ipt"]

c.相对路径+通配符

//*[@*="s_ipt"]

d.相对路径+文本匹配

 //a[text()="新闻"]

七.WebDriver的常用方法

1.click: 点击.

2.sendKeys: 在对象上模拟键盘输入.

3.clear: 清除对象输入的文本内容.

4.(不推荐使用)submit: 提交,和click作用一样,但是有弊端,如果点击的元素放在非form标签中,此时submit会报错(比如超链接(a标签)).

5.text: 用于获取元素的文本信息.

6.getAttribute: 获取属性值.

以上所有内容的代码练习

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import java.util.List;

import static java.lang.Thread.sleep;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        // 测试是否通过的标致
        boolean flag = false;
        ChromeOptions options = new ChromeOptions();
        //允许所有请求
        options.addArguments("--remote-allow-origins=*");
        WebDriver webDriver = new ChromeDriver(options);
        // 1.打开百度首页
        webDriver.get("https://www.baidu.com/");
        String title = webDriver.getTitle();
        String url = webDriver.getCurrentUrl();
        if (url.equals("https://www.baidu.com/") && title.equals("百度一下,你就知道")) {
            System.out.println("title和url正确");
        } else {
            System.out.println("title和url不正确");
        }
        // 2.两种定位元素的方式: 1.cssSelector 2.Xpath
        // 使用浏览器,按F12,选中要测试的位置,在代码中拷贝.
        // 找到百度搜索输入框
        // 第一种: cssSelector
        WebElement element =  webDriver.findElement(By.cssSelector("#kw"));
        // 第二种: Xpath
        //WebElement Element = webDriver.findElement(By.xpath("//*[@id=\"kw\"]"));
        // 3.输入信息
        element.sendKeys("别克君越艾维亚");
        // 4.找到百度一下按钮
        // 5.点击按钮
        webDriver.findElement(By.cssSelector("#su")).click();
        sleep(2000);
        // 6.校验
        List<WebElement> elements = webDriver.findElements(By.cssSelector("a"));
        for (int i = 0; i < elements.size(); ++i) {
            if(elements.get(i).getText().contains("别克君越") || elements.get(i).getText().contains("艾维亚")) {
                System.out.println("测试通过");
                flag = true;
                break;
            }
        }
        if (!flag) {
            System.out.println("测试不通过");
        }
        // 清空输入框
        element.clear();
        sleep(1500);
        // 在输入框中重新输入内容
        element.sendKeys("别克威朗");
        webDriver.findElement(By.cssSelector("#su")).submit();
        // 获取属性值:百度一下
        System.out.println(webDriver.findElement(By.cssSelector("#su")).getAttribute("value"));
    }
}

八.等待

1.强制等待(sleep): 一直等待到规定时间.

2.智能等待: 设置的等待时间是最长的等待时间,如果完成了任务,会停止.

a.隐式等待(webDriver.manage().timeouts().implicitlyWait())

b.显示等待: 指定某个任务进行等待.

区别: 隐式等待是等待页面上所有因素加载进来,如果规定时间内没有加载进来,就会报错.而显示等待并不关心是否加载进来所有的元素,只要在规定时间内,在所有被加载进来的元素中包含指定的元素,就不会报错.

3.代码练习

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.time.Duration;


public class Main2 {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接百度
        driver.get("https://www.baidu.com/");
        // 判断元素是否可以被点击

        // 隐式等待
//        driver.manage().timeouts().implicitlyWait(Duration.ofDays(5));

        // 显示等待
        WebDriverWait wait = new WebDriverWait(driver, Duration.ofMillis(3000));
        wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("#bottom_layer > div > p:nth-child(7) > a")));
    }
}

九.浏览器操作

1.前进: webdriver.navigate().back();

2.后退: webdriver.navigate().refresh();

3.刷新: webdriver.navigate().forward();

4.滚动条操作: 使用js脚本

划到最底端: 

((JavascriptExecutor)driver).executeScript("document.documentElement.scrollTop=10000");

5.最大化: driver.manage().window().maximize();

6.全屏: driver.manage().window().fullscreen();

7.设置长宽: driver.manage().window().setSize(new Dimension(600, 800));

8.代码

import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import static java.lang.Thread.sleep;

public class Main3 {
    public static void main(String[] args) throws InterruptedException {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接百度
        driver.get("https://www.baidu.com/");
        driver.findElement(By.cssSelector("#kw")).sendKeys("君越艾维亚");
        driver.findElement(By.cssSelector("#su")).click();
        sleep(1500);
        // 回退
        driver.navigate().back();
        sleep(1500);
        // 刷新
        driver.navigate().refresh();
        sleep(1500);
        // 前进
        driver.navigate().forward();
        sleep(1500);
        // 滚动,使用js脚本
        // 划到最底端
        ((JavascriptExecutor)driver).executeScript("document.documentElement.scrollTop=10000");
        sleep(1500);
        // 最大化
        driver.manage().window().maximize();
        sleep(1500);
        // 全屏
        driver.manage().window().fullscreen();
        sleep(1500);
        // 最小化
        driver.manage().window().minimize();
        // 设置长宽
        driver.manage().window().setSize(new Dimension(600, 800));
    }
}

十.键盘

1.control + a: 
driver.findElement(By.cssSelector("#kw")).sendKeys(Keys.CONTROL, "A");

2.代码

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import static java.lang.Thread.sleep;

public class Main4 {
    public static void main(String[] args) throws InterruptedException {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接百度
        driver.get("https://www.baidu.com/");
        driver.findElement(By.cssSelector("#kw")).sendKeys("君越艾维亚");
        // 键盘操作
        // control + A
        driver.findElement(By.cssSelector("#kw")).sendKeys(Keys.CONTROL, "A");
        sleep(1500);
        // control + X
        driver.findElement(By.cssSelector("#kw")).sendKeys(Keys.CONTROL, "X");
        sleep(1500);
        // control + V
        driver.findElement(By.cssSelector("#kw")).sendKeys(Keys.CONTROL, "V");
        sleep(1500);
    }
}

十一.鼠标

代码:

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;

import static java.lang.Thread.sleep;

public class Main5 {
    public static void main(String[] args) throws InterruptedException {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接百度
        driver.get("https://www.baidu.com/");
        driver.findElement(By.cssSelector("#kw")).sendKeys("君越艾维亚");
        driver.findElement(By.cssSelector("#su")).click();
        sleep(1500);
        // 鼠标操作
        WebElement element = driver.findElement(By.cssSelector("#s_tab > div > a.s-tab-item.s-tab-item_1CwH-.s-tab-pic_p4Uej.s-tab-pic"));
        Actions actions = new Actions(driver);
        sleep(1500);
        actions.moveToElement(element).contextClick().perform();

    }
}

十二.特殊场景

1.定位一组元素: 

勾选复选框

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import java.util.List;

public class Main6 {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接
        driver.get("???");
        List<WebElement> elements = driver.findElements(By.cssSelector("input"));
        // 遍历elements,如果vtype值是checkbox就点击
        // 使用
        for (int i = 0; i < elements.size(); ++i) {
            if (elements.get(i).getAttribute("type").contains("checkbox")) {
                elements.get(i).click();
            }
        }
    }
}

2.多框架定位: 在iframe中的a标签使用常规方法无法定位

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class Main7 {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接
        driver.get("???");
        // 对iframe底下的a标签进行操作,不能直接定位,需要先切换
        // 输入id号,找到指定的iframe
        driver.switchTo().frame("f1");
        driver.findElement(By.cssSelector("???")).click();
    }

}

3.下拉框处理:

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.Select;

public class Main8 {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接
        driver.get("???");
        // 获取下拉框的元素
        WebElement element = driver.findElement(By.cssSelector("???"));
        Select select = new Select(element);
        // 可以通过多种方式定位,常用以下两种
        // 1.下标定位(下标从0开始计数)
        select.deselectByIndex(0);
        // 2.根据value值定位
        select.deselectByValue("???");
    }
}

4.弹窗处理: 针对alert

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class Main9 {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接
        driver.get("???");
        // 点击弹窗
        driver.findElement(By.cssSelector("button")).click();
        // 取消弹窗
        driver.switchTo().alert().dismiss();
        // 点击弹窗
        driver.findElement(By.cssSelector("button")).click();
        // 输入内容
        driver.switchTo().alert().sendKeys("张三");
        // 点击确认
        driver.switchTo().alert().accept();
    }
}

5.上传文件

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class Main10 {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接
        driver.get("???");
        // 上传文件
        driver.findElement(By.cssSelector("???")).sendKeys("此处填写文件路径");

    }
}

十三.补充

1.关闭浏览器

a)driver.quit();

退出浏览器,清空缓存(如cookie).

b)driver.close();

关闭当前正在操作的页面(不是最新的页面,要看当前正在操作的页面)

c)代码

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import static java.lang.Thread.sleep;

public class Main11 {
    public static void main(String[] args) throws InterruptedException {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接百度
        driver.get("https://www.baidu.com/");
        driver.findElement(By.cssSelector("#s-top-left > a:nth-child(1)")).click();
        sleep(1500);
        //driver.close();
        driver.quit();
    }
}

2.切换窗口

a)driver.getWindowHandle();

获取页面句柄,不是最新的页面,是当前正在操作的页面.

b)Set<String> windowHandles = driver.getWindowHandles();

获取所有页面的局部,最后一个就是最新页面的句柄.

c)代码:

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import java.util.Set;

public class Main12 {
    public static void main(String[] args) {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接百度
        driver.get("https://www.baidu.com/");
        // 点击新的页面
        driver.findElement(By.cssSelector("#s-top-left > a:nth-child(1)")).click();
        System.out.println(driver.getWindowHandle());
        String handle = null;
        Set<String> windowHandles = driver.getWindowHandles();
        for (String str : windowHandles) {
            handle = str;
            System.out.println(str);
        }
    }
}

运行结果: 

3.截图

a)去maven中央仓库找common-io依赖(Apache Commons IO)

<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
        </dependency>

b) File screenshotAs = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
    FileUtils.copyFile(screenshotAs, new File("D://picture/123.png"));

c)代码

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import java.io.File;
import java.io.IOException;

import static java.lang.Thread.sleep;

public class Main13 {
    public static void main(String[] args) throws IOException, InterruptedException {
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--remote-allow-origins=*");
        // 创建驱动
        WebDriver driver = new ChromeDriver(options);
        // 连接百度
        driver.get("https://www.baidu.com/");
        driver.findElement(By.cssSelector("#kw")).sendKeys("别克君越艾维亚");
        driver.findElement(By.cssSelector("#su")).click();
        sleep(1500);
        File screenshotAs = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
        FileUtils.copyFile(screenshotAs, new File("D://picture/123.png"));
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/103076.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

LSM Tree 深度解析

我们将深入探讨日志结构合并树&#xff0c;也称为LSM Tree&#xff1a;这是许多高度可扩展的NoSQL分布式键值型数据库的基础数据结构&#xff0c;例如Amazon的DynamoDB、Cassandra和ScyllaDB。这些数据库的设计被认为支持比传统关系数据库更高的写入速率。我们将看到LSM Tree如…

分享10个创意满满的产品设计网站

在当今的互联网时代&#xff0c;新颖性和创造力是最受关注的&#xff0c;无论一个产品有多好&#xff0c;但没有创意的包装都很难“看到太阳”。因此&#xff0c;创意产品的设计非常重要&#xff0c;今天小将为您带来10个非常有创意的产品设计网站。话不多说&#xff0c;上干货…

越流行的大语言模型越不安全

源自&#xff1a;GoUpSec “人工智能技术与咨询” 发布 安全研究人员用OpenSSF记分卡对GitHub上50个最流行的生成式AI大语言模型项目的安全性进行了评估&#xff0c;结果发现越流行的大语言模型越危险。 近日&#xff0c;安全研究人员用OpenSSF记分卡对GitHub上50个最流…

Sentinel授权规则和规则持久化

大家好我是苏麟 , 今天说说Sentinel规则持久化. 授权规则 授权规则可以对请求方来源做判断和控制。 授权规则 基本规则 授权规则可以对调用方的来源做控制&#xff0c;有白名单和黑名单两种方式。 白名单&#xff1a;来源&#xff08;origin&#xff09;在白名单内的调用…

批量编辑 Outlook 联系人

现状 Outlook 自带的联系人编辑功能无法快速、批量编辑联系人字段使用 Excel 等外部编辑器&#xff0c;可批量编辑联系人 导出联系人到文件 在【联系人】界面&#xff0c;点击【文件】在【文件】界面&#xff0c;点击【打开和导出】–>【导入/导出】在弹出的向导窗口中点…

FPGA从入门到精通(二十)SignalTapII

这一篇将介绍SignalTapII。 之前的工程我们是做仿真&#xff0c;设置激励&#xff0c;观察输出波形去判断代码没有问题&#xff0c;但事实上我们真实的需求是综合后的代码下载到FPGA芯片中能够符合预期。 其中可能出现问题的原因有&#xff1a; 1、我们是写testbench设置激励…

接口自动化测试 —— Jmeter 6种定时器应用

①定时器是在每个sampler&#xff08;采样器&#xff09;之前执行的&#xff0c;而不是之后&#xff0c;不管这个定时器的位置放在sampler之后&#xff0c;还是之下&#xff0c;都在sampler之前得到执行 ②定时器是有作用域的&#xff0c;当执行一个sampler之前时&#xff0c;…

华为云2023年双十一服务器优惠价格表及活动大全

2023华为云双11优惠活动「云上优选 特惠来袭」&#xff0c;阿腾云atengyun.com整理云服务器优惠价格表&#xff0c;华为云L实例-2核2G3M一年优惠价89元、L实例-2核2G4M价格108元一年、L实例-2核4G5M优惠价198元一年&#xff0c;三年1000元、HECS云服务器-1核2G1M带宽39元一年、…

JavaScript 生成 16: 9 宽高比

这篇文章只是对 for 循环一个简单应用&#xff0c;没有什么知识含量。 可以跳过这篇文章。 只是我用来保存一下我的代码&#xff0c;保存在本地我嫌碍眼&#xff0c;总想把他删了。 正文部分 公式&#xff1a;其中 width 表示宽度&#xff0c;height 表示高度 16 9 w i d t…

大集合按照指定长度进行分割成多个小集合,用于批量多次处理数据

&#x1f4da;目录 拆分案例拆分的核心代码 通常我们对集合的更新或者保存都需要用集合来承载通过插入的效率&#xff0c;但是这个会遇到一个问题就是你不知道那天那个集合的数量可能就超了&#xff0c;虽然我们连接数据库进行批量提交会在配置上配置allowMultiQueriestrue,但是…

【c语言】结构体内存对齐,位段,枚举,联合

之前学完结构体&#xff0c;有没有对结构体的大小会很疑惑呢&#xff1f;&#xff1f;其实结构体在内存中存储时会存在内存对齐&#xff0c;捎带讲讲位段&#xff0c;枚举&#xff0c;和联合&#xff0c;跟着小张一起学习吧 结构体内存对齐 结构体的对齐规则: 第一个成员在与结…

Android 12 源码分析 —— 应用层 四(SystemUI的基本布局设计及其基本概念)

Android 12 源码分析 —— 应用层 四&#xff08;SystemUI的基本布局设计及其基本概念&#xff09; 在上两篇文章中&#xff0c;我们介绍SystemUI的启动过程&#xff0c;以及基本的组件依赖关系。基本的依赖关系请读者一定要掌握&#xff0c;因为后面的文章&#xff0c;将会时…

【力扣】416. 分割等和子集 <动态规划、回溯>

【力扣】416. 分割等和子集 给你一个 只包含正整数的非空数组 nums 。请你判断是否可以将这个数组分割成两个子集&#xff0c;使得两个子集的元素和相等。 示例 1&#xff1a; 输入&#xff1a;nums [1,5,11,5] 输出&#xff1a;true 解释&#xff1a;数组可以分割成 [1, 5,…

【Nacos】使用Nacos进行服务发现、配置管理

Nacos Nacos是 Dynamic Naming and Configuration Service 的首字母简称&#xff0c;一个更易于构建云原生应用的动态服务发现、配置管理和服务管理平台。 版本说明&#xff1a;版本说明 alibaba/spring-cloud-alibaba Wiki GitHub <properties><java.version>…

vue报错RangeError: Maximum call stack size exceeded

这种情况&#xff0c;一般是跳转路由时发生此类错误&#xff0c;像我的就是如此。比如路由指向的vue文件里代码有错误&#xff0c;或者设置路由时重定向了路由自己&#xff0c;造成死循环。 1、首先检查自己跳转的路由地址的代码本身是否有语法错误之类的&#xff0c;造成错误…

Python中的os模块:walk函数与listdir函数的深度解析

Python中的os模块&#xff1a;walk函数与listdir函数的深度解析 os.walk()函数listdir()函数使用场景案例一&#xff1a;遍历目录树并处理文件案例二&#xff1a;列出目录中的文件名并执行某些操作 总结 在Python中&#xff0c;os模块提供了许多与操作系统交互的功能&#xff0…

opencv案例06-基于opencv图像匹配的消防通道障碍物检测与深度yolo检测的对比

基于图像匹配的消防通道障碍物检测 技术背景 消防通道是指在各种险情发生时&#xff0c;用于消防人员实施营救和被困人员疏散的通道。消防法规定任何单位和个人不得占用、堵塞、封闭消防通道。事实上&#xff0c;由于消防通道通常缺乏管理&#xff0c;导致各种垃圾&#xff0…

(十九)大数据实战——Flume数据采集框架安装部署

前言 本节内容我们主要介绍一下大数据数据采集框架flume的安装部署&#xff0c;Flume 是一款流行的开源分布式系统&#xff0c;用于高效地采集、汇总和传输大规模数据。它主要用于处理大量产生的日志数据和事件流。Flume 支持从各种数据源&#xff08;如日志文件、消息队列、数…

【广州华锐互动】AR远程连接专家进行协同管理,解放双手让协同更便捷

AR远程协同系统是一种基于AR技术&#xff0c;实现远程设备维修和技术支持的系统。该系统通过将虚拟信息叠加在现实世界中&#xff0c;实现对设备的全方位监控和管理&#xff0c;并可以通过AR眼镜等终端设备&#xff0c;实时查看设备的各项数据和信息&#xff0c;为设备维修提供…

【算法日志】动态规划刷题:不相邻选择类问题(day40)

算法随想录刷题60Day 目录 前言 打家劫舍1 (数组) 打家劫舍2&#xff08;环形数组&#xff09; 打家劫舍3&#xff08;二叉树&#xff09; 前言 今天主要讨论不相邻选择类问题&#xff0c;会在不同数据结构题型的下探讨该类问题的解法。 打家劫舍1 (数组) 本题只需要讨论当…
最新文章