`
tcxiang
  • 浏览: 89558 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

webdriverd的使用(转)

 
阅读更多
 
<iframe src="http://www.baidu.com/ur/scun?title=webdriver%20API%E4%B8%AD%E6%96%87%E7%89%88&amp;ltu=http%3A%2F%2Fwww.360doc.com%2Fcontent%2F14%2F0629%2F20%2F16427364_390807525.shtml&amp;di=contentunion1040&amp;tn=SE_hldp00970_2vypufth&amp;_t=1404045958791" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" align="center,center" width="640" height="100"></iframe>

1.1   下载selenium2.0的lib包

http://code.google.com/p/selenium/downloads/list

 

官方UserGuide:http://seleniumhq.org/docs/

1.2   用webdriver打开一个浏览器

我们常用的浏览器有firefox和IE两种,firefox是selenium支持得比较成熟的浏览器。但是做页面的测试,速度通常很慢,严重影响持续集成的速度,这个时候建议使用HtmlUnit,不过HtmlUnitDirver运行时是看不到界面的,对调试就不方便了。使用哪种浏览器,可以做成配置项,根据需要灵活配置。

 

  1. 打开firefox浏览器:

        //Create a newinstance of the Firefox driver

        WebDriver driver = newFirefoxDriver();

 

  1. 打开IE浏览器

        //Create a newinstance of the Internet Explorer driver

        WebDriver driver = newInternetExplorerDriver ();

 

  1. 打开HtmlUnit浏览器

        //Createa new instance of the Internet Explorer driver    

        WebDriverdriver = new HtmlUnitDriver();

 

1.3   打开测试页面

对页面对测试,首先要打开被测试页面的地址(如:http://www.google.com),web driver 提供的get方法可以打开一个页面:

        // And now use thedriver to visit Google

        driver.get("http://www.google.com");

1.4   GettingStarted

package org.openqa.selenium.example;

 

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.firefox.FirefoxDriver;

import org.openqa.selenium.support.ui.ExpectedCondition;

import org.openqa.selenium.support.ui.WebDriverWait;

 

public class Selenium2Example {

    public static voidmain(String[] args) {

        // Create a newinstance of the Firefox driver

        // Notice that theremainder of the code relies on the interface,

        // not the implementation.

        WebDriver driver = newFirefoxDriver();

 

        // And now use this tovisit Google

       driver.get("http://www.google.com");

        // Alternatively thesame thing can be done like this

        // driver.navigate().to("http://www.google.com");

 

        // Find the text inputelement by its name

        WebElement element =driver.findElement(By.name("q"));

 

        // Enter something tosearch for

       element.sendKeys("Cheese!");

 

        // Now submit the form.WebDriver will find the form for us from the element

        element.submit();

 

        // Check the title ofthe page

       System.out.println("Page title is: " + driver.getTitle());

       

        // Google's search isrendered dynamically with JavaScript.

        // Wait for the pageto load, timeout after 10 seconds

        (newWebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {

         public Booleanapply(WebDriver d) {

                returnd.getTitle().toLowerCase().startsWith("cheese!");

            }

        });

 

        // Should see:"cheese! - Google Search"

       System.out.println("Page title is: " + driver.getTitle());

       

        //Close the browser

        driver.quit();

    }

}

第2章        Webdirver对浏览器的支持

2.1   HtmlUnit Driver

优点:HtmlUnit Driver不会实际打开浏览器,运行速度很快。对于用FireFox等浏览器来做测试的自动化测试用例,运行速度通常很慢,HtmlUnit Driver无疑是可以很好地解决这个问题。

缺点:它对JavaScript的支持不够好,当页面上有复杂JavaScript时,经常会捕获不到页面元素。

使用:

WebDriver driver = new HtmlUnitDriver();

 

2.2   FireFox Driver

优点:FireFox Dirver对页面的自动化测试支持得比较好,很直观地模拟页面的操作,对JavaScript的支持也非常完善,基本上页面上做的所有操作FireFox Driver都可以模拟。

缺点:启动很慢,运行也比较慢,不过,启动之后Webdriver的操作速度虽然不快但还是可以接受的,建议不要频繁启停FireFox Driver。

使用:

WebDriver driver = new FirefoxDriver();

Firefox profile的属性值是可以改变的,比如我们平时使用得非常频繁的改变useragent的功能,可以这样修改:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("general.useragent.override", "some UAstring");
WebDriver driver = new FirefoxDriver(profile);

2.3   InternetExplorer Driver

优点:直观地模拟用户的实际操作,对JavaScript提供完善的支持。

缺点:是所有浏览器中运行速度最慢的,并且只能在Windows下运行,对CSS以及XPATH的支持也不够好。

使用:

WebDriver driver = new InternetExplorerDriver();

 

第3章        使用操作

3.1  如何找到页面元素

Webdriver的findElement方法可以用来找到页面的某个元素,最常用的方法是用id和name查找。下面介绍几种比较常用的方法。

3.1.1 By ID

假设页面写成这样:

<input type="text" name="passwd"id="passwd-id" />

 

那么可以这样找到页面的元素:

通过id查找:

WebElement element = driver.findElement(By.id("passwd-id"));

3.1.2 By Name

或通过name查找:

WebElement element = driver.findElement(By.name("passwd"));

3.1.3 By XPATH

或通过xpath查找:

WebElement element =driver.findElement(By.xpath("//input[@id='passwd-id']"));

3.1.4 By Class Name

假设页面写成这样:

 

<div class="cheese"><span>Cheddar</span></div><divclass="cheese"><span>Gouda</span></div>

可以通过这样查找页面元素:

List<WebElement>cheeses = driver.findElements(By.className("cheese"));

 

3.1.5 By Link Text

假设页面元素写成这样:

<ahref="http://www.google.com/search?q=cheese">cheese</a>>

 那么可以通过这样查找:

WebElement cheese =driver.findElement(By.linkText("cheese"));

 

 

 

3.2  如何对页面元素进行操作

找到页面元素后,怎样对页面进行操作呢?我们可以根据不同的类型的元素来进行一一说明。

3.2.1 输入框(text field or textarea)

   找到输入框元素:

WebElement element = driver.findElement(By.id("passwd-id"));

在输入框中输入内容:

element.sendKeys(“test”);

将输入框清空:

element.clear();

获取输入框的文本内容:

element.getText();

 

3.2.2 下拉选择框(Select)

找到下拉选择框的元素:

Select select = new Select(driver.findElement(By.id("select")));

 
  选择对应的选择项:

select.selectByVisibleText(“mediaAgencyA”);

select.selectByValue(“MA_ID_001”);

 

不选择对应的选择项:

select.deselectAll();

select.deselectByValue(“MA_ID_001”);

select.deselectByVisibleText(“mediaAgencyA”);

或者获取选择项的值:

select.getAllSelectedOptions();

select.getFirstSelectedOption();

 

3.2.3 单选项(Radio Button)

找到单选框元素:

WebElement bookMode =driver.findElement(By.id("BookMode"));

选择某个单选项:

bookMode.click();

清空某个单选项:

bookMode.clear();

判断某个单选项是否已经被选择:

bookMode.isSelected();

3.2.4 多选项(checkbox)

多选项的操作和单选的差不多:

WebElement checkbox =driver.findElement(By.id("myCheckbox."));

checkbox.click();

checkbox.clear();

checkbox.isSelected();

checkbox.isEnabled();

3.2.5 按钮(button)

找到按钮元素:

WebElement saveButton = driver.findElement(By.id("save"));

点击按钮:

saveButton.click();

判断按钮是否enable:

 

saveButton.isEnabled ();

3.2.6 左右选择框

也就是左边是可供选择项,选择后移动到右边的框中,反之亦然。例如:

Select lang = new Select(driver.findElement(By.id("languages")));

lang.selectByVisibleText(“English”);

WebElement addLanguage =driver.findElement(By.id("addButton"));

addLanguage.click();

3.2.7 弹出对话框(Popup dialogs)

Alert alert = driver.switchTo().alert();

alert.accept();

alert.dismiss();

alert.getText();

3.2.8 表单(Form)

Form中的元素的操作和其它的元素操作一样,对元素操作完成后对表单的提交可以:

WebElement approve = driver.findElement(By.id("approve"));

approve.click();

approve.submit();//只适合于表单的提交

3.2.9 上传文件 (Upload File)

上传文件的元素操作:

WebElement adFileUpload = driver.findElement(By.id("WAP-upload"));

String filePath = "C:\test\\uploadfile\\media_ads\\test.jpg";

adFileUpload.sendKeys(filePath);

3.2.10                 Windows 和 Frames之间的切换

一般来说,登录后建议是先:

driver.switchTo().defaultContent();

切换到某个frame:

driver.switchTo().frame("leftFrame");

从一个frame切换到另一个frame:

driver.switchTo().frame("mainFrame");

切换到某个window:

driver.switchTo().window("windowName");

 

3.2.11                 拖拉(Drag andDrop)

WebElement element =driver.findElement(By.name("source"));

WebElement target = driver.findElement(By.name("target"));

 

(new Actions(driver)).dragAndDrop(element, target).perform();

 

3.2.12                 导航 (Navigationand History)

打开一个新的页面:

 driver.navigate().to("http://www.example.com");

 

通过历史导航返回原页面:

driver.navigate().forward();

driver.navigate().back();

3.3   高级使用

3.3.1 改变user agent

User Agent的设置是平时使用得比较多的操作:

FirefoxProfile profile = new FirefoxProfile();

profile.addAdditionalPreference("general.useragent.override","some UA string");

WebDriver driver = new FirefoxDriver(profile);

3.3.2 读取Cookies

我们经常要对的值进行读取和设置。

增加cookie:

// Now set the cookie. This one's valid for the entire domain

Cookie cookie = new Cookie("key", "value");

driver.manage().addCookie(cookie);

获取cookie的值:

// And now output all the available cookies for the current URL

Set<Cookie> allCookies = driver.manage().getCookies();

for (Cookie loadedCookie : allCookies) {

   System.out.println(String.format("%s -> %s",loadedCookie.getName(), loadedCookie.getValue()));

}

根据某个cookie的name获取cookie的值:

driver.manage().getCookieNamed("mmsid");

删除cookie:

 

// You can delete cookies in 3 ways

// By name

driver.manage().deleteCookieNamed("CookieName");

// By Cookie

driver.manage().deleteCookie(loadedCookie);

// Or all of them

driver.manage().deleteAllCookies();

3.3.3 调用Java Script

Web driver对Java Script的调用是通过JavascriptExecutor来实现的,例如:

JavascriptExecutor js = (JavascriptExecutor) driver;

js.executeScript("(function(){inventoryGridMgr.setTableFieldValue('"+ inventoryId + "','" + fieldName + "','"

                + value + "');})()");

 

3.3.4 Webdriver截图

如果用webdriver截图是:

driver = webdriver.Firefox()
driver.save_screenshot("C:\error.jpg")

3.3.5 页面等待

因为Load页面需要一段时间,如果页面还没加载完就查找元素,必然是查找不到的。最好的方式,就是设置一个默认等待时间,在查找页面元素的时候如果找不到就等待一段时间再找,直到超时。

Webdriver提供两种方法,一种是显性等待,另一种是隐性等待。

显性等待:

WebDriver driver =new FirefoxDriver();

driver.get("http://somedomain/url_that_delays_loading");

WebElementmyDynamicElement = (new WebDriverWait(driver, 10))

  .until(newExpectedCondition<WebElement>(){

  @Override

  public WebElementapply(WebDriver d) {

    returnd.findElement(By.id("myDynamicElement"));

  }});

 

隐性等待:

WebDriver driver = new FirefoxDriver();

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("http://somedomain/url_that_delays_loading");

WebElement myDynamicElement =driver.findElement(By.id("myDynamicElement"));

第4章        RemoteWebDriver

当本机上没有浏览器,需要远程调用浏览器进行自动化测试时,需要用到RemoteWebDirver.

4.1   使用RemoteWebDriver

import java.io.File;

import java.net.URL;

 

import org.openqa.selenium.OutputType;

import org.openqa.selenium.TakesScreenshot;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.remote.Augmenter;

import org.openqa.selenium.remote.DesiredCapabilities;

import org.openqa.selenium.remote.RemoteWebDriver;

 

public class Testing {

   

    public void myTest()throws Exception {

        WebDriver driver = newRemoteWebDriver(

                               new URL("http://localhost:4446/wd/hub"),

                               DesiredCapabilities.firefox());

       

       driver.get("http://www.google.com");

       

        // RemoteWebDriverdoes not implement the TakesScreenshot class

        // if the driver doeshave the Capabilities to take a screenshot

        // then Augmenter willadd the TakesScreenshot methods to the instance

        WebDriveraugmentedDriver = new Augmenter().augment(driver);

        File screenshot =((TakesScreenshot)augmentedDriver).

                            getScreenshotAs(OutputType.FILE);

    }

}

 

4.2   SeleniumServer

在使用RemoteDriver时,必须在远程服务器启动一个SeleniumServer:

java -jar selenium-server-standalone-2.20.0.jar -port 4446

4.3   How to setFirefox profile using RemoteWebDriver

profile = new FirefoxProfile();

           profile.setPreference("general.useragent.override",testData.getUserAgent()); 

capabilities = DesiredCapabilities.firefox();

capabilities.setCapability("firefox_profile", profile);

driver = new RemoteWebDriver(new URL(“http://localhost:4446/wd/hub”),capabilities);

driverWait = new WebDriverWait(driver,TestConstant.WAIT_ELEMENT_TO_LOAD);

driver.get("http://www.google.com");

 

第5章        封装与重用

WebDriver对页面的操作,需要找到一个WebElement,然后再对其进行操作,比较繁琐:

 // Find the text inputelement by its name

WebElement element = driver.findElement(By.name("q"));

 

// Enter something to search for

element.sendKeys("Cheese!");

我们可以考虑对这些基本的操作进行一个封装,简化操作。比如,封装代码:

    protected void sendKeys(Byby, String value){

       driver.findElement(by).sendKeys(value);

    }

那么,在测试用例可以这样简化调用:

sendKeys(By.name("q"),”Cheese!”);

 

看,这就简洁多了。

 

类似的封装还有:

package com.drutt.mm.end2end.actions;

 

 

import java.util.List;

import java.util.NoSuchElementException;

import java.util.concurrent.TimeUnit;

 

import org.openqa.selenium.By;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.remote.RemoteWebDriver;

import org.openqa.selenium.support.ui.WebDriverWait;

 

import com.drutt.mm.end2end.data.TestConstant;

 

public class WebDriverAction {

 

   //protected WebDriverdriver;

   protected RemoteWebDriverdriver;

   protected WebDriverWaitdriverWait;

 

 

    protected booleanisWebElementExist(By selector) {

        try {

            driver.findElement(selector);

            return true;

        } catch(NoSuchElementException e) {

            return false;

        }

    }

   

    protected StringgetWebText(By by) {

        try {

        return driver.findElement(by).getText();

        } catch (NoSuchElementException e) {

            return "Textnot existed!";

        }

    }

   

    protected voidclickElementContainingText(By by, String text){

        List<WebElement>elementList = driver.findElements(by);

        for(WebElement e:elementList){

            if(e.getText().contains(text)){

                e.click();

                break;

            }

        }    

    }

   

    protected StringgetLinkUrlContainingText(By by, String text){

        List<WebElement>subscribeButton = driver.findElements(by);

        String url = null;

        for(WebElement e:subscribeButton){

            if(e.getText().contains(text)){

                url =e.getAttribute("href");

                break;

            }

        }

        return url;

    }

   

    protected void click(Byby){

       driver.findElement(by).click();

       driver.manage().timeouts().implicitlyWait(TestConstant.WAIT_ELEMENT_TO_LOAD,TimeUnit.SECONDS);

    }

 

    protected StringgetLinkUrl(By by){

        return driver.findElement(by).getAttribute("href");

    }

   

    protected void sendKeys(Byby, String value){

       driver.findElement(by).sendKeys(value);

    }

 

第6章        在selenium2.0中使用selenium1.0的API

Selenium2.0中使用WeDriver API对页面进行操作,它最大的优点是不需要安装一个selenium server就可以运行,但是对页面进行操作不如selenium1.0的Selenium RC API那么方便。Selenium2.0提供了使用Selenium RC API的方法:

// You may use any WebDriver implementation. Firefox is used hereas an example

WebDriver driver = new FirefoxDriver();

 

// A "base url", used by selenium to resolve relativeURLs

 String baseUrl ="http://www.google.com";

 

// Create the Selenium implementation

Selenium selenium = new WebDriverBackedSelenium(driver, baseUrl);

 

// Perform actions with selenium

selenium.open("http://www.google.com");

selenium.type("name=q", "cheese");

selenium.click("name=btnG");

 

// Get the underlying WebDriver implementation back. This willrefer to the

// same WebDriver instance as the "driver" variableabove.

WebDriver driverInstance = ((WebDriverBackedSelenium)selenium).getUnderlyingWebDriver();

 

    //Finally, close thebrowser. Call stop on the WebDriverBackedSelenium instance

    //instead of callingdriver.quit(). Otherwise, the JVM will continue running after

    //the browser has beenclosed.

    selenium.stop();

 

我分别使用WebDriver API和SeleniumRC API写了一个Login的脚本,很明显,后者的操作更加简单明了。

WebDriver API写的Login脚本:

    public void login() {

        driver.switchTo().defaultContent();

        driver.switchTo().frame("mainFrame");

 

        WebElement eUsername= waitFindElement(By.id("username"));

        eUsername.sendKeys(manager@ericsson.com);

 

        WebElement ePassword= waitFindElement(By.id("password"));

        ePassword.sendKeys(manager);

 

        WebElementeLoginButton = waitFindElement(By.id("loginButton"));

       eLoginButton.click();

 

    }

   

SeleniumRC API写的Login脚本:

    public void login() {

        selenium.selectFrame("relative=top");

        selenium.selectFrame("mainFrame");

        selenium.type("username","manager@ericsson.com");

        selenium.type("password","manager");

        selenium.click("loginButton");

}

分享到:
评论

相关推荐

    基于 OpenCV 的魔兽世界钓鱼机器人

    基于 OpenCV 的魔兽世界钓鱼机器人

    供应链管理中信息共享问题的研究.docx

    供应链管理中信息共享问题的研究

    青春文学中的爱情观呈现.doc

    青春文学中的爱情观呈现

    分布式光伏储能系统的优化配置方法 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    Delphi 12.3 控件之XLSReadWriteII6.02.01.7z

    XLSReadWriteII6.02.01.7z

    图解系统-小林coding-v1.0.rar

    图解系统-小林coding-v1.0

    【光伏功率预测】基于EMD-PCA-LSTM的光伏功率预测模型 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    漫画作品与乌托邦理想追求.doc

    漫画作品与乌托邦理想追求

    江苏建筑消防设施维护保养规程.rar

    江苏建筑消防设施维护保养规程.rar

    基于交互式可视化的Transformer模型注意机制探索工具-DODRIO及其应用

    内容概要:论文介绍了一款名为DODRIO的交互式可视化工具,帮助自然语言处理(NLP)研究人员和从业者解析基于转换器架构的语言模型内部工作机理。DODRIO整合了概述图与详尽视图,支持用户比较注意力权重与其输入文本的句法结构和语义特征。具体而言,它包含了依赖关系视图(Dependency View)、语义关注图(Semantic Attention Graph)以及注意力头概览(Attention Head Overview),并利用不同的图形展示方法使复杂的多层多头转换器模型中的注意力模式更容易理解和研究。 适用人群:适用于从事深度学习、自然语言处理的研究人员和技术从业者;尤其适合对基于变换器架构的大规模预训练语言模型感兴趣的开发者们。 使用场景及目标:DODRIO用于探索转换器模型各层级之间的联系、验证已有研究成果,同时激发新假设形成。具体使用时可以选择特定数据集中的句子作为样本输入,观察不同注意力机制如何响应文本内容的变化。此外,还可以用来对比精简版本DistilBERT的表现,评估其相对全量模型BERT的优势与不足。 其他说明:DODRIO为开源项目,提供web端实施方式,使得

    基于机器学习的疾病数据集分析

    该代码使用scikit-learn的乳腺癌数据集,完成分类模型训练与评估全流程。主要功能包括:数据标准化、三类模型(逻辑回归、随机森林、SVM)的训练、模型性能评估(分类报告、混淆矩阵、ROC曲线)、随机森林特征重要性分析及学习曲线可视化。通过`train_test_split`划分数据集,`StandardScaler`标准化特征,循环遍历模型进行统一训练和评估。关键实现细节包含:利用`classification_report`输出精确度/召回率等指标,绘制混淆矩阵和ROC曲线量化模型效果,随机森林的特征重要性通过柱状图展示,学习曲线分析模型随训练样本变化的拟合趋势。最终将原始数据和预测结果保存为CSV文件,便于后续分析,并通过matplotlib进行多维度可视化比较。代码结构清晰,实现了数据处理、模型训练、评估与可视化的整合,适用于乳腺癌分类任务的多模型对比分析。

    数字化智慧园区建设实施PPT(43页).pptx

    在智慧城市建设的大潮中,智慧园区作为其中的璀璨明珠,正以其独特的魅力引领着产业园区的新一轮变革。想象一下,一个集绿色、高端、智能、创新于一体的未来园区,它不仅融合了科技研发、商业居住、办公文创等多种功能,更通过深度应用信息技术,实现了从传统到智慧的华丽转身。 智慧园区通过“四化”建设——即园区运营精细化、园区体验智能化、园区服务专业化和园区设施信息化,彻底颠覆了传统园区的管理模式。在这里,基础设施的数据收集与分析让管理变得更加主动和高效,从温湿度监控到烟雾报警,从消防水箱液位监测到消防栓防盗水装置,每一处细节都彰显着智能的力量。而远程抄表、空调和变配电的智能化管控,更是在节能降耗的同时,极大地提升了园区的运维效率。更令人兴奋的是,通过智慧监控、人流统计和自动访客系统等高科技手段,园区的安全防范能力得到了质的飞跃,让每一位入驻企业和个人都能享受到“拎包入住”般的便捷与安心。 更令人瞩目的是,智慧园区还构建了集信息服务、企业服务、物业服务于一体的综合服务体系。无论是通过园区门户进行信息查询、投诉反馈,还是享受便捷的电商服务、法律咨询和融资支持,亦或是利用云ERP和云OA系统提升企业的管理水平和运营效率,智慧园区都以其全面、专业、高效的服务,为企业的发展插上了腾飞的翅膀。而这一切的背后,是大数据、云计算、人工智能等前沿技术的深度融合与应用,它们如同智慧的大脑,让园区的管理和服务变得更加聪明、更加贴心。走进智慧园区,就像踏入了一个充满无限可能的未来世界,这里不仅有科技的魅力,更有生活的温度,让人不禁对未来充满了无限的憧憬与期待。

    Matlab实现BO贝叶斯优化-Transformer-GRU多特征分类预测的详细项目实例(含完整的程序,GUI设计和代码详解)

    内容概要:本文档介绍了基于MATLAB实现的贝叶斯优化(BO)、Transformer和GRU相结合的多特征分类预测项目实例,涵盖了详细的程序设计思路和具体代码实现。项目旨在应对数据的多样性与复杂性,提供一种更高效的多特征数据分类解决方案。文档主要内容包括:项目背景与意义,技术难点与解决方案,具体的实施流程如数据处理、模型构建与优化、超参数调优、性能评估以及精美的GUI设计;详细说明了Transformer和GRU在多特征数据分类中的应用及其与贝叶斯优化的有效结合,强调了其理论与实际应用中的价值。 适合人群:具备一定机器学习和MATLAB编程基础的研发人员,特别是从事多维数据处理与预测工作的专业人士和技术爱好者。 使用场景及目标:① 适用于金融、医疗、交通等行业,进行复杂的多维数据处理和预测任务;② 提升现有分类任务中复杂数据处理的准确度和效率,为各行业提供智能预测工具,如金融市场预测、患者病情发展跟踪、交通流量管理等。 其他说明:本文档包含了丰富的实战案例和技术细节,不仅限于模型设计本身,还涉及到数据清洗、模型优化等方面的知识,帮助使用者深入理解每一步骤背后的原理与实现方法。通过完整的代码样例和GUI界面设计指导,读者可以从头到尾跟随文档搭建起一套成熟的分类预测系统。

    Hive sql练习题,只是参考作用

    大数据的sql练习题,初级中级高级

    基于自注意力机制的序列转换模型-Transformer的提出及其应用

    内容概要:论文介绍了名为Transformer的新网络架构,它完全基于自注意力机制,在不使用递归或卷积神经网络的情况下建模输入与输出之间的全局依赖关系,尤其适用于长文本处理。通过多头自注意力层和平行化的全连接前馈网络,使得在机器翻译任务上的表现优于当时最佳模型。具体地,作者用此方法实现了对英语-德语和英语-法语翻译、句法解析等任务的高度并行化计算,并取得显著效果。在实验方面,Transformer在较短训练时间内获得了高质量的翻译结果以及新的单一模型基准。除此之外,研究人员还探索了模型变体的效果及其对于不同参数变化时性能的变化。 适用人群:从事自然语言处理领域的研究者、工程师、学生,熟悉深度学习概念尤其是编码器-解码器模型以及关注模型创新的人士。 使用场景及目标:主要适用于序列到序列(seq2seq)转换任务如机器翻译、语法分析、阅读理解和总结等任务的研究和技术开发;目标在于提高计算效率、缩短训练时间的同时确保模型性能达到或超过现有技术。 其他说明:本文不仅提出了一个新的模型思路,更重要的是展示了自注意力机制相较于传统LSTM或其他方式所拥有的优势,例如更好地捕捉远距离上下文关系的能力

    【故障诊断】一种滚动体轴承或齿轮的重复瞬态提取方法研究 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    用于平抑可再生能源功率波动的储能电站建模及评价 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    使用 KTH 数据集进行人类行为识别 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    【深度学习】基于计算机视觉的自动驾驶应用 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    自己写的远控木马,欢迎各位大佬改善

    自己写的远控木马,欢迎各位大佬改善

Global site tag (gtag.js) - Google Analytics