Macaca 介绍
源码空间:https://github.com/macacajs
模块拆分讲解:
Macaca
1. macaca-cli
Macaca提供的命令行工具
$macaca server
启动server
$macaca server --verbose
启动server并打印详细日志
$macaca doctor
检验当前macaca环境配置
2. app-inspector
macaca提供的元素查找工具,可以将app视图的结构以布局结构树的格式在浏览器上展示出来,用过点击某个元素,就可以方便的查询到该控件的基本信息,以方便查找。具体使用可参考官网: https://macacajs.com/inspector
3. UI Recorder
macaca提供的脚本录制工具,可以通过录制获得脚本,对于入门同学很有帮助。https://macacajs.com/recorder
WebDriver-Server
Macaca是按照经典的Server-Client设计模式进行设计的,也就是我们常说的C/S架构。WebDriver-server部分便充当了server这部分的角色,他的职责就是等待client发送请求并做出响应。
WebDriver-Client
client端简单来讲就是我们的测试代码,我们测试代码中的一些行为,比如控件查找、点击等,这些行为以http请求的方式发送给server,server接收请求,并执行相应操作,并在response中返回执行状态、返回值等信息。
也正是基于这种经典的C/S架构,所以client端具有跨语言的特点,macaca-wd,wd.java,wd.py分别是Macaca团队针对Js Java 以及Python的封装,只要能保证client端按照指定的要求发送Http请求,任意语言都可以。
DriverList
自动化要在不同的平台上跑,需要有对应平台的驱动,这部分驱动接收到来自server的操作命令,驱动各自平台的底层完成对应的操作。
1. Android
Macaca针对安卓平台的驱动集合
macaca-android 安卓驱动
macaca-adb 封装了安卓的adb命令,来实现一些adb的操作,比如安装、卸载、启动app、获取设备列表这些操作
android-unicode 经过封装后的输入法,解决中文输入的问题
uiautomator-client 将来自server的操作指令转换为UIAutomator可以识别的指令,驱动uiautomator完成对应的操作
android-performance 用于自动化测试安卓性能相关的支持
2. iOS
Macaca针对iOS平台的驱动集合
macaca-ios iOS驱动
xctest-client 同安卓的uiautomator-client异曲同工,对XCUITest的封装,将来自server的操作指令转换为XCUITest可以识别的指令,驱动XCUITest完成对应的操作
ios-simulator 用于对ios模拟器的支持,可以通过模拟器运行用例
remote-debug 用于远程调试
3. Hybrid
Macaca针对Hybrid的驱动集合。
macaca-chrome web测试驱动
macaca-chromedriver 驱动chrome浏览器
ios-webkit-debug-proxy 适用于iOS平台对webview的调试
4. Electron
Macaca针对pc端网页应用的支持
快速开始:从无到有搭建 Macaca 环境 (forMac)
https://macacajs.com/zh/quick-start
基础环境准备
安装Homebrew
参考官网
简易安装步骤(最新可参考官网)
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装Node和npm
$ brew install node
安装后可以用node -v查看版本号,如果正常则说明安装成功,Macaca2.0要求当前node版本要高于6.0,如果以前安装过低版本的Node,可以通过如下命令更新Node版本:
$brew upgrade node
安装cnpm
https://cnpmjs.org/
npm是node.js的包管理工具,可以用他来安装和更新各种node的pacakage,可以理解为Java中Maven类似的作用,但是由于众所周知的那堵墙,直接用npm安装速度会非常慢,这种情况下可以安装阿里巴巴提供的cnpm,cnpm提供了国内的镜像,可以加快包的下载速度,安装方法如下: 命令行工具输入如下命令:
$npm install -g cnpm --registry=https://registry.npm.taobao.org
如果在安装过程中提示 Permission 权限相关错误,可以尝试 USER /usr/local,永久破除 sudo 要求。
安装成功后同样可以通过cnpm -v来验证安装是否成功,安装成功后,在原来使用npm的地方,直接替换成cnpm即可, 比如,原始命令为
$npm i -g macaca-cli
替换后为:
$cnpm i -g macaca-cli
Macaca相关安装
iOS
如果不针对iOS作自动化,可以忽略此处
安装XCode(依赖Mac电脑,AppStore下载即可)
安装相关工具
$ brew install usbmuxd$ brew install ios-webkit-debug-proxy
$ brew install carthage
Android
安装JDK Macaca支持JDK7及以上,可到官网选择对应版本安装 官网下载 注意安装后需要配置JAVA_HOME环境变量,如果本地命令行工具用的是mac系统的默认命令行工具,将其配置到 ~/.bashprofile中,如果用的是zsh,将其配置到 ~/.zshrc中,如下:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home"
环境变量修改后需要source一下进行更新,比如如果修改的是~/.zshrc,需要执行$source ~/.zshrc
更新后执行echo $JAVA_HOME 如果能正常打印出环境变量,则证明环境变量已经配置成功.
安装Android Studio 官方安装
3.安装gradle(用于打包UIAutomatorWD)
$ brew install gradle
配置gradle环境变量,如果本地命令行工具用的是mac系统的默认命令行工具,将其配置到/.bashprofile中,如果用的是zsh,将其配置到 /.zshrc中,如下:
export GRADLE_HOME="/usr/local/bin/gradle"
环境变量修改后需要source一下进行更新,比如如果修改的是~/.zshrc,需要执行$source ~/.zshrc
更新后执行GRADLE_HOME 如果能正常打印出环境变量,则证明环境变量已经配置成功
4.安装&配置安卓sdk
通过AndroidStudio内的sdkmanager安装安卓依赖的sdk版本,操作路径: AndroidStudio -> Tools -> Android -> SDK Manager
需要安装的依赖: SDK Platforms : Android 6.0及以上版本 SDK Tools: Android SDK Platform-Tools && Android SDK Tools && NDK 具体勾选效果如下:
上面第一张图中红框标记的ANDROID_HOME地址是安卓SDK的路径,需要配置到环境变量中,配置方法同gradle一样
如上都配置好后,需要将两个环境变量拼接到系统的PATH变量中,全部配置完成后的内容如下:
Macaca命令行工具安装
macaca-cli为macaca的命令行工具,集成了macaca doctor等命令
$ cnpm i -g macaca-cli
// 备注 -g 表示全局安装,如果不加-g参数会在当前目录下安装macaca-cli
驱动安装
执行如下命令安装对应不同平台的驱动,可以选择性安装
$ cnpm i macaca-ios -g // iOS驱动(用于iOS平台自动化)$ cnpm i macaca-android -g // Android驱动(用于安卓平台自动化)$ cnpm i macaca-chrome -g // chrome 驱动$ cnpm i macaca-electron -g // electron 驱动
备注:
当需要更新相应驱动时,直接执行如上的安装命令即可
cnpm i macaca-ios -g 如果提示 xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance 命令行执行如下即可: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
至此,便完成了完整的Macaca相关环境的安装,此时我们可以通过macaca doctor命令检查当前环境配置:
如图为常规的Macaca环境配置结果,现在Macaca在环境上做了相对严格的校验,如果有部分依赖安装不成功,会给出相应的提示,针对性解决即可。
https://macacajs.com/
代码实例
https://github.com/microu2018/macaca-java-biz-sample
macaca-chromedriver
https://github.com/macacajs/macaca-chromedriver
awesome-macaca
A curated list of awesome things regarding Macaca ecosystem.
Table of Contents
Resources
Tutorials
Examples
Clients
Tools
Inspector
Recorder
DataHub
Marmot
Coverage
NoSmoke
Monkey Testing
Computer Vision
Page UITest
Browser Testing
Reporter
Bot
Other Tools
Drivers
Video
Articles
Presentations
Community
Contributing
Licence
Resources
Macaca Official Site
Macaca GitHub
Macaca Community GitHub
Macaca FAQ
Tutorials
Quick Start
Environment Setup
CLI Documentation
Examples
sample-nodejs - Macaca test sample for Node.js
sample-java - Macaca test sample for Java
sample-python - Macaca test sample for Python
react-sample - Macaca test sample for browser React
vue-sample - Macaca test sample for browser framework Vue.js
webpack-datahub-sample - Webpack proxy middleware sample for DataHub
antd-sample - Ant Design sample for DataHub
angular-datahub-sample - Angular's ng toolchain sample for DataHub
android-datahub-sample - Android sample for DataHub
ios-datahub-sample - iOS sample for DataHub
macaca-java-biz-framework - A framework for uiautomation business development based on wd.java
macaca-java-biz-sample - Sample for Macaca business development based on wd.java
macaca-reporter-standalone-sample - Sample for Macaca reporter
android-docker-ci-sample - Sample for Macaca docker ci
cv-sample-python - Sample for Macaca CV Python
macaca_ci_android_ios - Macaca iOS 和 Android 并行测试
po-sample-python - 基于 PageObject 跨平台的设计模式
Clients
macaca-wd - Node.js WebDriver Client for Macaca
wd.java - Java client binding for Macaca
wd.py - Python client binding for Macaca
Tools
Inspector
App-inspector - App-inspector is a mobile UI viewer in browser
Recorder
UI Recorder - UI Recorder is a UI test case recorder like Selenium IDE
DataHub
DataHub - Continuous data provider for development, testing, staging and production.
datahub-proxy-middleware - DataHub proxy middleware for Express.js
datahub-nodejs-sdk - DataHub Node.js SDK
datahub-java-sdk - DataHub SDK for Android and Java applications
datahub-ios-sdk - DataHub SDK for iOS
egg-datahub - Egg.js plugin for Macaca DataHub
umi-plugin-datahub - UmiJS plugin for Macaca DataHub
Marmot
Marmot - Release management suite with continuous delivery support for deployments
Coverage
web-coverage-sample - Coverage sample for Web
android-coverage-sample Coverage sample for Android
ios-coverage-sample Coverage sample for iOS
NoSmoke
NoSmoke - A cross platform UI crawler which scans view trees then generate and execute UI test cases.
Monkey Testing
zhangzhao4444/Fastmonkey - 非插桩 iOS Monkey, 支持控件,每秒4-5 action事件
baozhida/iosMonkey - 基于 Macaca 和 webdriveragent 模拟 monkey 的执行
mengdegong/iosMonkey - iOS Monkey
zalando/SwiftMonkey - A framework for doing randomised UI testing of iOS apps
Computer Vision
nodecv - Node.js binding to OpenCV
nodecv-server - NodeCV server side
Page UITest
Torchjs - Test framework to light up the world
uitest - UI Test framework for Node.js based on Macaca
Browser Testing
f2etest - F2etest是一个多浏览器兼容性测试整体解决方案
Reporter
macaca-reporter - Macaca reporter is a reporter used for mocha and other frameworks
Bot
macaca-bot - :octocat: bot to resolve the issues and PR of Macaca
Other Tools
macaca-adb - Node.js wrapper for ADB
XCTestWD - A Swift implementation of WebDriver server for iOS that runs on Simulator/iOS devices
ios-simulator - Node.js wrapper for iOS simulator
UIAutomatorWD - Node.js wrapper for Android UIAutomator
iosHookViewId - A solution for ios hook view id
android-unicode - Android unicode UTF-7 input apk
command-line-test - command-line test tool for Node.js
android-performance - Node.js wrapper to android performance with adb
Drivers
macaca-android - Macaca Android driver
macaca-ios - Macaca iOS driver
macaca-chrome - Macaca Chrome driver
macaca-electron - Macaca Electron driver
macaca-puppeteer - Macaca Puppeteer driver
Video
Macaca Test Framework - Youtube Channels
Articles
English
Can you find XPath for mobile apps?
Extract Xpath from App using Macaca Inspector
Macaca inspector for Apple Mac - Automation Testing World!!
Mobile and Web UI Testing with Macaca and OpenCV
Chinese
UI 自动化框架调研总结
基于 Node.js 的自动化持续集成
获取 Android 应用的性能
小马 Macaca 入门指引合集
Macaca-Java 版入门指南
Mac OSX 布署 Reliable
Macaca 基础原理浅析
应用自动添加控件 ID 探索
Strikingly 团队2017技术展望
Macaca 测试用例单步调试
混合 H5 应用 UI 自动化入门
Android 输入中文的实现
Presentations
Slides
Automation Facing The Future
Community
Testerhome
Cnodejs
StackOverflow
Contributing
Your contributions and suggestions are always welcome! :smiley:
Contributors
This project follows the git-contributor spec, auto upated at Sat Apr 21 2018 17:02:08 GMT+0800
.
License
[图片上传失败...(image-c99436-1537499061724)]
macaca-wd.js
'use strict';
/**
* Query the server's current status.
* @summary Support: Android iOS Web(WebView)
* @returns {Promise.} The server's current status.
*/
function status() {}
/**
* Create a new session.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dfn-new-session|POST /session}
* @param {Object} desired Desired Capabilities
* @type session
* @returns {Promise.}
*/
function init(desired) {}
/**
* Returns a list of the currently active sessions.
* @summary Support: Android iOS Web(WebView)
* @returns {Promise.}
*/
function sessions() {}
/**
* Delete the session.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dfn-delete-session|DELETE /session/:sessionId}
* @returns {Promise}
* @type session
*/
function quit() {}
/**
* Get the current context.
* @summary Support: Android iOS
* @returns {Promise.}
*/
function currentContext() {}
/**
* Set the current context.
* @summary Support: Android iOS
* @param {string} contextRef context reference from contexts
* @returns {Promise}
*/
function context(contextRef) {}
/**
* Get a list of the available contexts.
* @summary Support: Android iOS
* @returns {Promise.} A list of available contexts.
*/
function contexts() {}
/**
* Set the amount of time the driver should wait.
* @summary Support: Android iOS Web(WebView)
* @param {number} ms The amount of time to wait, in milliseconds
* @returns {Promise}
*/
function sleep(ms) {}
/**
* Take a screenshot of the current page.
* @summary Support: Android iOS Web(WebView)
* @returns {Promise.} The screenshot as a base64 encoded PNG.
*/
function takeScreenshot() {}
/**
* Save the screenshot of the current page.
* @summary Support: Android iOS Web(WebView)
* @param {str} filepath The path to save the screenshot or left blank (will create a file in the system temp dir).
* @returns {Promise.} The filepath of the screenshot.
*/
function saveScreenshot(filepath) {}
/**
* Get the current page source.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dfn-get-page-source|GET /session/:sessionId/source}
* @returns {Promise.}
*/
function source() {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} using The locator strategy to use.
* @param {string} value The search target.
* @returns {Promise.}
*/
function element(using, value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The class name
* @returns {Promise.}
*/
function elementByClassName(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The css selector
* @returns {Promise.}
*/
function elementByCss(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The ID attribute
* @returns {Promise.}
*/
function elementById(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The name attribute
* @returns {Promise.}
*/
function elementByName(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The text
* @returns {Promise.}
*/
function elementByLinkText(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The partially text
* @returns {Promise.}
*/
function elementByPartialLinkText(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The tag name
* @returns {Promise.}
*/
function elementByTagName(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The XPath expression
* @returns {Promise.}
*/
function elementByXPath(value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} using The locator strategy to use.
* @param {string} value The search target.
* @returns {Promise.}
*/
function elements(using, value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} value The class name
* @returns {Promise.}
*/
function elementsByClassName(value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} value The css selector
* @returns {Promise.}
*/
function elementsByCss(value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} value The ID attribute
* @returns {Promise.}
*/
function elementsById(value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} value The name attribute
* @returns {Promise.}
*/
function elementsByName(value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} value The text
* @returns {Promise.}
*/
function elementsByLinkText(value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} value The partially text
* @returns {Promise.}
*/
function elementsByPartialLinkText(value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} value The tag name
* @returns {Promise.}
*/
function elementsByTagName(value) {}
/**
* Search for multiple elements on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/elements}
* @param {string} value The XPath expression
* @returns {Promise.}
*/
function elementsByXPath(value) {}
/**
* All the element-related methods above (except which suffixed with OrNull, IfExists) could be prefixed with the "waitFor-" (need to capitalize the 'e', e.g., waitForElementByClassName)
* @summary Support: Android iOS Web(WebView)
* @param {string} using The locator strategy to use, omitted when using specific method like waitForElementByClassName.
* @param {string} value The css selector
* @param {function} [asserter] The asserter function (commonly used asserter function can be found at wd.asserters) (optional)
* @param {number} [timeout=1000ms] The timeout before find the element (optional)
* @param {number} [interval=200ms] The interval between each searching (optional)
* @example waitForElementByClassName('btn', 2000, 100) Search for element which class name is 'btn' at intervals of 100ms, last for 2000ms.
* @returns {Promise.}
*/
function waitForElement(using, value, asserter, timeout, interval) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} using The locator strategy to use.
* @param {string} value The search target.
* @returns {Promise.}
*/
function elementOrNull(using, value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The class name
* @returns {Promise.}
*/
function elementByClassNameOrNull(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The css selector
* @returns {Promise.}
*/
function elementByCssOrNull(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The ID attribute
* @returns {Promise.}
*/
function elementByIdOrNull(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The name attribute
* @returns {Promise.}
*/
function elementByNameOrNull(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The text
* @returns {Promise.}
*/
function elementByLinkTextOrNull(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The partially text
* @returns {Promise.}
*/
function elementByPartialLinkTextOrNull(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The tag name
* @returns {Promise.}
*/
function elementByTagNameOrNull(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The XPath expression
* @returns {Promise.}
*/
function elementByXPathOrNull(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} using The locator strategy to use.
* @param {string} value The search target.
* @returns {Promise.}
*/
function elementIfExists(using, value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The class name
* @returns {Promise.}
*/
function elementByClassNameIfExists(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The css selector
* @returns {Promise.}
*/
function elementByCssIfExists(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The ID attribute
* @returns {Promise.}
*/
function elementByIdIfExists(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The name attribute
* @returns {Promise.}
*/
function elementByNameIfExists(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The text
* @returns {Promise.}
*/
function elementByLinkTextIfExists(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The partially text
* @returns {Promise.}
*/
function elementByPartialLinkTextIfExists(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The tag name
* @returns {Promise.}
*/
function elementByTagNameIfExists(value) {}
/**
* Search for an element on the page, starting from the document root.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The XPath expression
* @returns {Promise.}
*/
function elementByXPathIfExists(value) {}
/**
* Check if element exists.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} using The locator strategy to use.
* @param {string} value The search target.
* @type assert
* @returns {Promise.}
*/
function hasElement(using, value) {}
/**
* Check if element exists.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The class name.
* @type assert
* @returns {Promise.}
*/
function hasElementByClassName(value) {}
/**
* Check if element exists.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The ID attribute.
* @type assert
* @returns {Promise.}
*/
function hasElementById(value) {}
/**
* Check if element exists.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The name attribute.
* @type assert
* @returns {Promise.}
*/
function hasElementByName(value) {}
/**
* Check if element exists.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The text.
* @type assert
* @returns {Promise.}
*/
function hasElementByLinkText(value) {}
/**
* Check if element exists.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The partially text.
* @type assert
* @returns {Promise.}
*/
function hasElementByPartialLinkText(value) {}
/**
* Check if element exists.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The tag name.
* @type assert
* @returns {Promise.}
*/
function hasElementByTagName(value) {}
/**
* Check if element exists.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#elements|POST /session/:sessionId/element}
* @param {string} value The XPath expression.
* @type assert
* @returns {Promise.}
*/
function hasElementByXPath(value) {}
/**
* Click on an element.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dfn-element-click|POST /session/:sessionId/element/:id/click}
* @returns {Promise}
*/
function click() {}
/**
* Send a sequence of key strokes to the active element.
* @summary Support: Android iOS Web(WebView)
* @param {string} keys The keys sequence to be sent.
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dfn-element-send-keys|POST /session/:sessionId/element/:id/sendKeys}
* @type element
* @returns {Promise}
*/
function sendKeys(keys) {}
/**
* Send a sequence of key strokes to the active window.
* @summary Support: Android Web(WebView) More: https://github.com/alibaba/macaca/issues/487
* @param {string} keys The keys sequence to be sent.
* @returns {Promise}
*/
function keys(keys) {}
/**
* Returns the visible text for the element.
* @summary Support: Android iOS Web(WebView)
* @type element
* @returns {Promise.}
*/
function text() {}
/**
* Clear a TEXTAREA or text INPUT element's value.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#element-clear|POST /session/:sessionId/element/:id/clear}
* @type element
* @returns {Promise.}
*/
function clear() {}
/**
* Determine if an element is currently displayed.
* @summary Support: Android Web(WebView)
* @type element
* @returns {Promise.}
*/
function isDisplayed() {}
/**
* Get the result of a property of a element.
* @summary Support: Android iOS Web(WebView). iOS: 'isVisible', 'isAccessible', 'isEnabled', 'type', 'label', 'name', 'value', Android: 'selected', 'description', 'text'
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dfn-get-element-property|GET /session/:sessionId/element/:id/property/:name}
* @param {string} name The property name
* @type element
* @returns {Promise.}
*/
function getProperty(name) {}
/**
* Query the value of an element's computed CSS property.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#get-element-css-value|GET /session/:sessionId/element/:id/css/:propertyName}
* @param {string} propertyName The property name
* @type element
* @returns {Promise.}
*/
function getComputedCss(propertyName) {}
/**
* Get the dimensions and coordinates of the given element with a object including x/y/height/width.
* @summary Support: Android iOS.
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dfn-get-element-rect|GET /session/:sessionId/element/:id/rect}
* @type element
* @returns {Promise.}
*/
function getRect() {}
/**
* Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#executing-script|POST /session/:sessionId/execute}
* @param code script
* @param [args] script argument array
* @returns {Promise.}
*/
function execute() {}
/**
* Get the current page title or focus activity or viewController.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#accept-alert|GET /session/:sessionId/title}
* @returns {Promise.}
*/
function title() {}
/**
* Accepts the currently displayed alert dialog.
* @summary Support: Android iOS
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#accept-alert|POST /session/:sessionId/accept_alert}
* @returns {Promise.}
*/
function acceptAlert() {}
/**
* Dismisses the currently displayed alert dialog.
* @summary Support: Android iOS
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dismiss-alert|POST /session/:sessionId/dismiss_alert}
* @returns {Promise.}
*/
function dismissAlert() {}
/**
* Gets the text of the currently displayed JavaScript alert(), confirm(), or prompt() dialog.
* @summary Support: iOS
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#send-alert-text|GET /session/:sessionId/alert_text}
* @returns {Promise.}
*/
function alertText() {}
/**
* Sends keystrokes to a JavaScript prompt() dialog.
* @summary Support: iOS
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#send-alert-text|POST /session/:sessionId/alert_text}
* @param keys
* @returns {Promise.}
*/
function alertKeys() {}
/**
* Retrieve the URL of the current page.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#get-current-url|GET /session/:sessionId/url}
* @returns {Promise.}
*/
function url() {}
/**
* Navigate to a new URL.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#get|POST /session/:sessionId/url}
* @param url get a new url.
* @type browser
* @returns {Promise.}
*/
function get() {}
/**
* Navigate forwards in the browser history, if possible.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#back|POST /session/:sessionId/forward}
* @type browser
* @returns {Promise.}
*/
function forward() {}
/**
* Navigate backwards in the browser history, if possible.
* @summary Support: Android Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#back|POST /session/:sessionId/back}
* @type browser
* @returns {Promise.}
*/
function back() {}
/**
* Refresh the current page.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#refresh|POST /session/:sessionId/refresh}
* @type browser
* @returns {Promise.}
*/
function refresh() {}
/**
* Change focus to another window.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#switch-to-window|POST /session/:sessionId/window}
* @returns {Promise.}
*/
function window() {}
/**
* Close the current window.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#close-window|DELETE /session/:sessionId/window}
* @type window
* @returns {Promise.}
*/
function close() {}
/**
* Retrieve the current window handle.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#get-window-handle|GET /session/:sessionId/window_handle}
* @returns {Promise.}
*/
function windowHandle() {}
/**
* Retrieve the list of all window handles available to the session.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#get-window-handles|GET /session/:sessionId/window_handles}
* @returns {Promise.}
*/
function windowHandles() {}
/**
* Get the size of the specified window.
* @summary Support: Android iOS Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#get-window-size|GET /session/:sessionId/window/size}
* @param [handle] window handle to set size for (optional, default: 'current')
* @returns {Promise.}
*/
function getWindowSize() {}
/**
* Change the size of the specified window.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#set-window-size|POST /session/:sessionId/window/size}
* @param width width in pixels to set size to
* @param height height in pixels to set size to
* @param [handle] window handle to set size for (optional, default: 'current')
* @returns {Promise.}
*/
function setWindowSize() {}
/**
* Maximize the specified window if not already maximized.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#dfn-maximize-window|POST /session/:sessionId/window/maximize}
* @param handle window handle
* @type browser
* @returns {Promise.}
*/
function maximize() {}
/**
* Change focus to another frame on the page.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#switch-to-frame|POST /session/:sessionId/frame}
* @param {string|number|null} frameRef Identifier(id/name) for the frame to change focus to
* @returns {Promise.}
*/
function frame(frameRef) {}
/**
* Apply touch actions on devices.
* @summary Support: iOS, Android
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#actions|POST /session/:sessionId/actions}
* @param {string} action Name of the action, tap/doubleTap/press/pinch/rotate/drag.
* @param [object] args Parameters of the action {@link https://github.com/alibaba/macaca/issues/366 more params}
* @example driver.touch('doubleTap', {x: 100, y: 100});
* @returns {Promise.}
*/
function touch(action, args) {}
/**
* Returns all cookies associated with the address of the current browsing context’s active document.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#get-all-cookies|GET /session/:sessionId/cookie}
* @returns {Promise.}
*/
function allCookies() {}
/**
* Adds a single cookie to the cookie store associated with the active document’s address. {url: 'https://macacajs.github.io', name:'foo', value:'bar'} Optional cookie fields: secure, expiry
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#add-cookie|POST /session/:sessionId/cookie}
* @returns {Promise.}
*/
function setCookie() {}
/**
* Delete either a single cookie by parameter name, or all the cookies associated with the active document’s address if name is undefined.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#delete-cookie|DELETE /session/:sessionId/cookie/:name}
* @returns {Promise.}
*/
function deleteCookie() {}
/**
* Allows deletion of all cookies associated with the active document’s address.
* @summary Support: Web(WebView)
* @see {@link https://w3c.github.io/webdriver/webdriver-spec.html#delete-all-cookies|DELETE /session/:sessionId/cookie/:name}
* @returns {Promise.}
*/
function deleteAllCookies() {}
const helper = require('./helper');
const wd = require('../wd/lib/main');
module.exports = wd;
module.exports.helper = helper;
module.exports.webpackHelper = helper(wd);
你可能感兴趣的:(Macaca 极简教程)
轻松获取京东商品信息:商品详情API接口使用教程
lovelin+vI7809804594
API学习 大数据 python json 爬虫 后端 数据库开发
在电子商务的繁荣时代,商品信息的准确性和实时性对于商家、消费者以及各类电商平台来说至关重要。京东,作为中国领先的电商平台之一,其商品信息更是蕴含着巨大的商业价值和市场洞察。本文将为您详细介绍如何使用京东商品详情API接口,轻松获取京东上的商品信息,并分享一些实用的技巧和注意事项,帮助您更好地利用这一强大工具。一、京东商品信息的重要性京东商品信息不仅包括了商品的基本属性(如名称、价格、规格、图片等)
Spring Boot2 系列教程(三十)Spring Boot 整合 Ehcache
2401_84048290
程序员 spring boot java spring
工程创建完成后,引入Ehcache的依赖,Ehcache目前有两个版本:这里采用第二个,在pom.xml文件中,引入Ehcache依赖:org.springframework.bootspring-boot-starter-cacheorg.springframework.bootspring-boot-starter-webnet.sf.ehcacheehcache2.10.6添加Ehcache
在 Ubuntu 22.04 上搭建 Dify 应用的完整指南
jdfklaakjsdf
AIGC ubuntu linux 运维
Dify是一款开源的AI应用开发平台,支持快速构建基于大语言模型(如GPT-3、ChatGLM等)的应用。本教程将详细演示如何在Ubuntu22.04系统上部署Dify。一、环境准备1.系统要求Ubuntu22.04LTS最低配置:2核CPU/4GB内存/20GB硬盘推荐配置:4核CPU/8GB内存/40GB硬盘2.更新系统sudoaptupdate&&sudoaptupgrade-ysudoap
AWS Security Finding Format (ASFF) 与 yolov3 with mobilenet v2 的集成教程
侯忱励
AWSSecurityFindingFormat(ASFF)与yolov3withmobilenetv2的集成教程ASFFyolov3withmobilenetv2andASFF项目地址:https://gitcode.com/gh_mirrors/as/ASFF1.项目介绍ASFF,全称是AWSSecurityFindingFormat,是由AWS设计的一种标准安全发现格式,用于在Securit
一周学会Flask3 Python Web开发-Jinja2模版中加载静态文件
java1234_小锋
Flask3视频教程 python flask flask3
锋哥原创的Flask3PythonWeb开发Flask3视频教程:2025版Flask3Pythonweb开发视频教程(无废话版)玩命更新中~_哔哩哔哩_bilibili一个Web项目不仅需要HTML模板,还需要许多静态文件,比如CSS、JavaScript文件、图片以及音频等。在Flask程序中,默认我们需要将静态文件存储在与主脚本(包含程序实例的脚本)同级目录的static文件夹中。在Jinj
【地图视界-Leaflet1】快速搭建你的第一个地图
Anchenry
GIS可视化 # 地图视界 前端 html 信息可视化
引言随着Web技术的飞速发展,交互式地图已经成为网站不可或缺的一部分。无论是位置定位、数据可视化,还是复杂的空间分析,地图应用都在现代互联网应用中占据着重要地位。而Leaflet作为一款轻量级、开源的JavaScript库,凭借其极简的设计、高效的性能和易于上手的特性,成为了开发交互式地图应用的首选工具之一。本文将通过详细介绍Leaflet的使用,帮助你从零基础开始,逐步构建出自己的地图应用。什么
AI探索笔记:线性回归
安意诚Matrix
机器学习笔记 人工智能 笔记 线性回归
前言写这篇博客,主要是自己来练练手。网络上教程已经是数不胜数,也都讲得非常清楚了。但自己不动手,知识和能力还是别人的。下面分别用传统方法(sklearn)和神经网络(pytorch)来解决线性回归问题。内容什么是线性回归线性回归(LinearRegression)是统计学和机器学习中最基础且广泛使用的预测模型,用于建立**自变量(输入特征)与因变量(输出目标)**之间的线性关系模型。其核心思想是通
【保姆级视频教程(二)】YOLOv12训练数据集构建:标签格式转换-划分-YAML 配置 避坑指南 | 小白也能轻松玩转目标检测!
一只云卷云舒
YOLOv12保姆级通关教程 YOLO 目标检测 人工智能 Ultralytics 数据集 YOLOv12 小白教程
【2025全站首发】YOLOv12训练数据集构建:标签格式转换-划分-YAML配置避坑指南|小白也能轻松玩转目标检测!文章目录1.数据集准备1.1标签格式转换1.2数据集划分1.3yaml配置文件创建2.训练验证1.数据集准备示例数据集下载链接:PKU-Market-PCB数据集1.1标签格式转换cursorprompt请撰写一个py脚本。将@Annotations文件夹下的所有类别的xml格式的
Vue中如何轻松实现可调整大小的容器布局——vue-resizeable组件教程
介绍vue-resizeable是一款在vue项目中可调整各个区域大小的组件,支持任意组合,支持自定义样式演示体验地址https://liquanquan.top/vue-admin/resizablenpm地址https://www.npmjs.com/package/vue-resizeablegithubhttps://github.com/taoman/vue-resizeable欢迎各位
视觉SLAM十四讲 第7讲 (3) 相机运动估计 2D-2D/3D-2D/3D-3D
LYF0816LYF
slam learning 3d 计算机视觉 算法 slam
相机运动估计2D-2D/3D-2D/3D-3D1.2D-2D:对极约束2.三角测量3.3D-2D:PnP3.1直接线性变换DLT3.2P3P3.3最小化投影误差求解PnP4.3D-3D:ICP4.1SVD方法4.2非线性优化方法5.总结若已经有匹配好的点对,要根据点对估计相机的运动,可以分为以下三种情况:2D-2D:即点对都是2D点,比如单目相机匹配到的点对。我们可以用对极几何来估计相机的运动。在
深入miniqmt:掌握创建交易对象的关键步骤
量化投资技术
量化软件 Python 量化 miniQMT QMT 量化交易 量化投资
深入miniqmt:掌握创建交易对象的关键步骤量化软件开通量化实战教程在量化交易的世界中,miniqmt是一个强大的工具,它允许开发者通过编程方式执行复杂的交易策略。本文将详细介绍如何在miniqmt中创建和配置交易对象,这是实现自动化交易的第一步。技术背景与应用场景在程序化交易系统中,交易对象是执行下单、撤单等操作的核心组件。通过创建并配置这些对象,我们可以与交易平台建立连接,订阅账户信息,并注
【CodeBlocks】搭建OpenCV环境指南
万众珩
【CodeBlocks】搭建OpenCV环境指南CodeBlocks搭建OpenCV环境项目地址:https://gitcode.com/Resource-Bundle-Collection/e1e1a本资源提供了详细的教程,帮助您在CodeBlocks集成开发环境中顺利搭建OpenCV环境。OpenCV是一个开源的计算机视觉和机器学习软件库,广泛应用于图像处理和视频分析领域。通过这篇指南,即便是
使用NestJS的控制器与业务逻辑结合的入门教程
XymkMl
JavaScript
NestJS是一个用于构建高效、可扩展的Node.js应用程序的框架。它采用了现代化的JavaScript或TypeScript语言,并提供了强大的依赖注入、模块化和面向切面编程等功能。本教程将介绍如何在NestJS应用程序中结合控制器和业务逻辑,以实现灵活且可维护的代码结构。步骤1:创建NestJS应用程序首先,我们需要安装NestJSCLI工具,用于创建和管理NestJS应用程序。打开终端并执
Vue学习教程-16html标签元素绑定事件
番茄番茄君
vue.js 学习 前端
文章目录前言一、表单数据绑定事件二、多媒体元素绑定1.图片img和视频元素video三、容器元素绑定事件前言在Vue中,你可以通过v-on指令(或在Vue2.x中简写为@)来绑定事件。这种方式允许你监听DOM事件,并在触发时执行一些JavaScript代码。常见的元素主要是表单数据元素、多媒体元素和容器元素。一、表单数据绑定事件常见的表单数据元素1.文本输入框元素3.多选框元素4.下拉框元素5.按
Node.js使用教程
m0_74823408
面试 学习路线 阿里巴巴 node.js vim 编辑器
Node.js使用教程Node.js是一个基于ChromeV8引擎的JavaScript运行环境,它让JavaScript运行在服务器端。以下是一个简单的Node.js使用教程:一、Node.js开发环境和编译1.1安装Node.js访问Node.js官网下载并安装适合您操作系统的Node.js版本。1.2创建一个Node.js项目在您的工作目录中,创建一个新的文件夹作为项目目录,例如命名为my_
最全面的 Markdown 语法参考手册
markdown
全面掌握Markdown:本教程详细介绍了Markdown的基本语法和扩展语法,包括标题、段落、列表、代码、链接、图片等,并提供实用技巧,助您快速上手,高效创建结构化文档。无论您是编写文档、笔记、博客,还是进行内容创作,都能从中获益。同时,本手册还涵盖了CommonMark规范,助您了解Markdown的底层原理。文章目录Markdown基本语法标题(Headings)")段落(Paragraph
百度 SEO:不是玄学,是科学与艺术的 “恋爱”
百度seoseo程序员后端算法
百度SEO:不是玄学,是科学与艺术的“恋爱”一、关键词优化关键词研究利用百度指数(https://index.baidu.com/)、百度关键词规划师等工具,挖掘与你的网站主题或产品相关的热门关键词和长尾关键词。例如,如果你是一个健身网站,除了“健身”这样的热门词,还可以挖掘“上班族健身计划”“女性产后健身教程”等长尾关键词。这些长尾关键词搜索意图更明确,竞争相对较小,更容易获得排名。分析竞争对手
实用教程:如何填写Google AdSense 美国税务信息W-8BEN 表单?
adsense
在申请和使用GoogleAdsense进行广告变现时,不管你是否在美国,只要有美国地区的收入,都会涉及到美国税务问题。Google作为扣缴义务人,根据美国税法,需要对相关收入进行预扣税款。因此,我们需要提供正确的税务信息,以避免更高的税款扣除,甚至影响正常的收款。本文将详细讲解为什么需要提交美国税务信息,以及如何正确填写W-8BEN表单,以避免不必要的税款预扣。为什么GoogleAdsense需要
pandas series 相加_Numpy和Pandas教程
weixin_39778393
pandas series 相加
Pandas简介-python数据分析library-基于numpy(对ndarray的操作)-有一种用python做Excel/SQL/R的感觉-为什么要学习pandas?-pandas和机器学习的关系,数据预处理,featureengineering。-pandas的DataFrame结构和大家在大数据部分见到的spark中的DataFrame非常类似。目录-numpy速成-Series-Da
mongodb【实用教程】
朝阳39
# 数据库 mongodb 数据库
MongoDB是一个开源的文档型数据库管理系统下载安装Windows系统https://blog.csdn.net/weixin_41192489/article/details/126777309GUI工具【推荐】MongoDBCompasshttps://www.mongodb.com/zh-cn/docs/compass/current/Robo3Thttps://blog.csdn.net
[Android] 在AndroidStudio中使用Python
Microsoda
android python 开发语言
这篇文章不包含Python的安装教程,请确保你已经安装好Python解释器。安装Chaquopy在/build.gradle中添加如下语句:plugins{id'com.chaquo.python'version'14.0.2'applyfalse}在/app/src/build.gradle中添加如下语句:plugins{id'com.android.application'id'com.cha
机器学习数学基础:32.复本信度
@心都
机器学习 算法 人工智能
复本信度(Parallel-FormsReliability)深度详解教程专为小白打造,零基础也能轻松掌握一、深度解读复本信度复本信度,也被称为“平行测验信度”,其核心要义是借助两个虽然不同但在各方面等效的测验版本,对同一批受测者进行多次测量,然后对测量结果的一致性程度展开评估。从本质上讲,它是衡量测验稳定性的重要指标,能够有效减少因题目重复出现而致使受测者产生练习或记忆效应,进而影响测验结果真实
Svelte 最新中文文档教程(22)—— 自定义元素
前言Svelte,一个语法简洁、入门容易,面向未来的前端框架。从Svelte诞生之初,就备受开发者的喜爱,根据统计,从2019年到2024年,连续6年一直是开发者最感兴趣的前端框架No.1:Svelte以其独特的编译时优化机制著称,具有轻量级、高性能、易上手等特性,非常适合构建轻量级Web项目。为了帮助大家学习Svelte,我同时搭建了Svelte最新的中文文档站点。如果需要进阶学习,也可以入手我
node设置镜像源详细教程
Roc-xb
node node.js
在Node.js环境中,你可以通过设置npm或yarn的镜像源来加速依赖包的下载。以下是如何设置npm和yarn的镜像源的详细步骤:使用npm设置镜像源临时设置镜像源:你可以在安装包时临时指定镜像源,例如:npminstallpackage-name--registry=https://registry.npmmirror.com永久设置镜像源:你可以通过配置npm的全局配置文件来永久设置镜像源:
OpenAI函数调用:使用Assistants API函数工具的一个示例
营赢盈英
AI python openai llm gpt Assistants
AreyoulookingtoexpandGPT'scapabilities?CheckoutthistutorialforacompleteexampleofanAIAssistantthatcansendemailswheneverweaskitto.您是否希望扩展GPT的功能?查看这个教程,它提供了一个完整的示例,展示了一个AI助手如何在我们要求时发送电子邮件。Newupdateson17t
通过Python编程语言实现“机器学习”小项目教程案例
指尖下的技术
DeepSeek python 机器学习 开发语言
以下为你提供一个使用Python实现简单机器学习项目的教程案例,此案例将使用鸢尾花数据集进行分类任务,运用经典的支持向量机(SVM)算法。步骤1:环境准备首先,你要确保已经安装了必要的Python库,像scikit-learn、pandas、matplotlib和seaborn。可以使用以下命令进行安装:pipinstallscikit-learnpandasmatplotlibseaborn步骤
自编大模型系列之 01 使用 Python 从头构建 LLaMA 3 编写您自己的十亿参数LLM(教程含源码)
知识大胖
NVIDIA GPU和大语言模型开发教程 python llama 开发语言
LLaMA3是继Mistral之后最有前途的开源模型之一,可以解决各种任务。我之前在Medium上写过一篇博客,介绍如何使用LLaMA架构从头开始创建一个具有超过230万个参数的LLM。现在LLaMA-3已经发布,我们将以更简单的方式重新创建它。我们不会在本博客中使用GPU,但您至少需要17GB的RAM,因为我们将加载一些大小超过15GB的文件。如果这对您来说是个问题,您可以使用Kaggle作为解
python曲线回归小案例教程
jackispy
python 回归 开发语言
一、曲线回归的定义曲线回归是一种统计方法,用于建立自变量(独立变量)和因变量(依赖变量)之间的非线性关系模型。与线性回归不同,线性回归假设自变量和因变量之间的关系是线性的,即可以通过一条直线来描述数据点的趋势;而曲线回归则允许这种关系是非线性的,可能表现为曲线、抛物线、指数、对数或其他复杂的数学形式。其主要特征如下:非线性关系:曲线回归适用于那些不能用直线来充分描述的数据关系。它允许模型以曲线形式
FFmpeg+vvenc实现H.266的视频编解码教程
ICUD
ffmpeg h.266 视频编解码 人工智能
Linux系统:FFmpeg+vvenc实现H.266的视频编解码教程(视频压缩)关键网址ffmpeg目前支持libvvenc,因此配置好libvvenc只会在一些make、sudomakeinstall命令时遇到问题,例如默认安装或配置路径指定错误、ffmpeg版本、vvenc版本匹配等问题。但无论哪些问题,几乎都可以在以下链接中找到相应的答案:https://github.com/fraunh
【星云 Orbit-F4 开发板】03f. 按键玩法六:按住一个独立按键不松手的加速匀速触发
智木芯语
【星云 Orbit-F4 开发板】 单片机 stm32 嵌入式硬件
【星云Orbit-F4开发板】03f.按键玩法六:按住一个独立按键不松手的加速匀速触发引言在嵌入式系统中,按键不仅是输入设备,还可以通过检测按键的持续状态来实现复杂的控制逻辑。本文将详细介绍如何使用STM32F407的GPIO引脚检测按键的长按状态,并通过HAL库实现加速匀速触发功能。通过本教程,读者将能够掌握独立按键的长按检测方法以及加速匀速触发的实现技巧。硬件准备在开始编程之前,确保您已经准备
ios内付费
374016526
ios 内付费
近年来写了很多IOS的程序,内付费也用到不少,使用IOS的内付费实现起来比较麻烦,这里我写了一个简单的内付费包,希望对大家有帮助。
具体使用如下:
这里的sender其实就是调用者,这里主要是为了回调使用。
[KuroStoreApi kuroStoreProductId:@"产品ID" storeSender:self storeFinishCallBa
20 款优秀的 Linux 终端仿真器
brotherlamp
linux linux视频 linux资料 linux自学 linux教程
终端仿真器是一款用其它显示架构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台连接上了服务器的客户机。终端仿真器允许最终用户用文本用户界面和命令行来访问控制台和应用程序。(LCTT 译注:终端仿真器原意指对大型机-哑终端方式的模拟,不过在当今的 Linux 环境中,常指通过远程或本地方式连接的伪终端,俗称“终端”。)
你能从开源世界中找到大量的终端仿真器,它们
Solr Deep Paging(solr 深分页)
eksliang
solr深分页 solr分页性能问题
转载请出自出处:http://eksliang.iteye.com/blog/2148370
作者:eksliang(ickes) blg:http://eksliang.iteye.com/ 概述
长期以来,我们一直有一个深分页问题。如果直接跳到很靠后的页数,查询速度会比较慢。这是因为Solr的需要为查询从开始遍历所有数据。直到Solr的4.7这个问题一直没有一个很好的解决方案。直到solr
数据库面试题
18289753290
面试题 数据库
1.union ,union all
网络搜索出的最佳答案:
union和union all的区别是,union会自动压缩多个结果集合中的重复结果,而union all则将所有的结果全部显示出来,不管是不是重复。
Union:对两个结果集进行并集操作,不包括重复行,同时进行默认规则的排序;
Union All:对两个结果集进行并集操作,包括重复行,不进行排序;
2.索引有哪些分类?作用是
Android TV屏幕适配
酷的飞上天空
android
先说下现在市面上TV分辨率的大概情况
两种分辨率为主
1.720标清,分辨率为1280x720.
屏幕尺寸以32寸为主,部分电视为42寸
2.1080p全高清,分辨率为1920x1080
屏幕尺寸以42寸为主,此分辨率电视屏幕从32寸到50寸都有
适配遇到问题,已1080p尺寸为例:
分辨率固定不变,屏幕尺寸变化较大。
如:效果图尺寸为1920x1080,如果使用d
Timer定时器与ActionListener联合应用
永夜-极光
java
功能:在控制台每秒输出一次
代码:
package Main;
import javax.swing.Timer;
import java.awt.event.*;
public class T {
private static int count = 0;
public static void main(String[] args){
Ubuntu14.04系统Tab键不能自动补全问题解决
随便小屋
Ubuntu 14.04
Unbuntu 14.4安装之后就在终端中使用Tab键不能自动补全,解决办法如下:
1、利用vi编辑器打开/etc/bash.bashrc文件(需要root权限)
sudo vi /etc/bash.bashrc
接下来会提示输入密码
2、找到文件中的下列代码
#enable bash completion in interactive shells
#if
学会人际关系三招 轻松走职场
aijuans
职场
要想成功,仅有专业能力是不够的,处理好与老板、同事及下属的人际关系也是门大学问。如何才能在职场如鱼得水、游刃有余呢?在此,教您简单实用的三个窍门。
第一,多汇报
最近,管理学又提出了一个新名词“追随力”。它告诉我们,做下属最关键的就是要多请示汇报,让上司随时了解你的工作进度,有了新想法也要及时建议。不知不觉,你就有了“追随力”,上司会越来越了解和信任你。
第二,勤沟通
团队的力
《O2O:移动互联网时代的商业革命》读书笔记
aoyouzi
读书笔记
移动互联网的未来:碎片化内容+碎片化渠道=各式精准、互动的新型社会化营销。
O2O:Online to OffLine 线上线下活动
O2O就是在移动互联网时代,生活消费领域通过线上和线下互动的一种新型商业模式。
手机二维码本质:O2O商务行为从线下现实世界到线上虚拟世界的入口。
线上虚拟世界创造的本意是打破信息鸿沟,让不同地域、不同需求的人
js实现图片随鼠标滚动的效果
百合不是茶
JavaScript 滚动属性的获取 图片滚动 属性获取 页面加载
1,获取样式属性值
top 与顶部的距离
left 与左边的距离
right 与右边的距离
bottom 与下边的距离
zIndex 层叠层次
例子:获取左边的宽度,当css写在body标签中时
<div id="adver" style="position:absolute;top:50px;left:1000p
ajax同步异步参数async
bijian1013
jquery Ajax async
开发项目开发过程中,需要将ajax的返回值赋到全局变量中,然后在该页面其他地方引用,因为ajax异步的原因一直无法成功,需将async:false,使其变成同步的。
格式:
$.ajax({ type: 'POST', ur
Webx3框架(1)
Bill_chen
eclipse spring maven 框架 ibatis
Webx是淘宝开发的一套Web开发框架,Webx3是其第三个升级版本;采用Eclipse的开发环境,现在支持java开发;
采用turbine原型的MVC框架,扩展了Spring容器,利用Maven进行项目的构建管理,灵活的ibatis持久层支持,总的来说,还是一套很不错的Web框架。
Webx3遵循turbine风格,velocity的模板被分为layout/screen/control三部
【MongoDB学习笔记五】MongoDB概述
bit1129
mongodb
MongoDB是面向文档的NoSQL数据库,尽量业界还对MongoDB存在一些质疑的声音,比如性能尤其是查询性能、数据一致性的支持没有想象的那么好,但是MongoDB用户群确实已经够多。MongoDB的亮点不在于它的性能,而是它处理非结构化数据的能力以及内置对分布式的支持(复制、分片达到的高可用、高可伸缩),同时它提供的近似于SQL的查询能力,也是在做NoSQL技术选型时,考虑的一个重要因素。Mo
spring/hibernate/struts2常见异常总结
白糖_
Hibernate
Spring
①ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
缺少aspectjweaver.jar,该jar包常用于spring aop中
②java.lang.ClassNotFoundException: org.sprin
jquery easyui表单重置(reset)扩展思路
bozch
form jquery easyui reset
在jquery easyui表单中 尚未提供表单重置的功能,这就需要自己对其进行扩展。
扩展的时候要考虑的控件有:
combo,combobox,combogrid,combotree,datebox,datetimebox
需要对其添加reset方法,reset方法就是把初始化的值赋值给当前的组件,这就需要在组件的初始化时将值保存下来。
在所有的reset方法添加完毕之后,就需要对fo
编程之美-烙饼排序
bylijinnan
编程之美
package beautyOfCoding;
import java.util.Arrays;
/*
*《编程之美》的思路是:搜索+剪枝。有点像是写下棋程序:当前情况下,把所有可能的下一步都做一遍;在这每一遍操作里面,计算出如果按这一步走的话,能不能赢(得出最优结果)。
*《编程之美》上代码有很多错误,且每个变量的含义令人费解。因此我按我的理解写了以下代码:
*/
Struts1.X 源码分析之ActionForm赋值原理
chenbowen00
struts
struts1在处理请求参数之前,首先会根据配置文件action节点的name属性创建对应的ActionForm。如果配置了name属性,却找不到对应的ActionForm类也不会报错,只是不会处理本次请求的请求参数。
如果找到了对应的ActionForm类,则先判断是否已经存在ActionForm的实例,如果不存在则创建实例,并将其存放在对应的作用域中。作用域由配置文件action节点的s
[空天防御与经济]在获得充足的外部资源之前,太空投资需有限度
comsci
资源
这里有一个常识性的问题:
地球的资源,人类的资金是有限的,而太空是无限的.....
就算全人类联合起来,要在太空中修建大型空间站,也不一定能够成功,因为资源和资金,技术有客观的限制....
&
ORACLE临时表—ON COMMIT PRESERVE ROWS
daizj
oracle 临时表
ORACLE临时表 转
临时表:像普通表一样,有结构,但是对数据的管理上不一样,临时表存储事务或会话的中间结果集,临时表中保存的数据只对当前
会话可见,所有会话都看不到其他会话的数据,即使其他会话提交了,也看不到。临时表不存在并发行为,因为他们对于当前会话都是独立的。
创建临时表时,ORACLE只创建了表的结构(在数据字典中定义),并没有初始化内存空间,当某一会话使用临时表时,ORALCE会
基于Nginx XSendfile+SpringMVC进行文件下载
denger
应用服务器 Web nginx 网络应用 lighttpd
在平常我们实现文件下载通常是通过普通 read-write方式,如下代码所示。
@RequestMapping("/courseware/{id}")
public void download(@PathVariable("id") String courseID, HttpServletResp
scanf接受char类型的字符
dcj3sjt126com
c
/*
2013年3月11日22:35:54
目的:学习char只接受一个字符
*/
# include <stdio.h>
int main(void)
{
int i;
char ch;
scanf("%d", &i);
printf("i = %d\n", i);
scanf("%
学编程的价值
dcj3sjt126com
编程
发一个人会编程, 想想以后可以教儿女, 是多么美好的事啊, 不管儿女将来从事什么样的职业, 教一教, 对他思维的开拓大有帮助
像这位朋友学习:
http://blog.sina.com.cn/s/articlelist_2584320772_0_1.html
VirtualGS教程 (By @林泰前): 几十年的老程序员,资深的
二维数组(矩阵)对角线输出
飞天奔月
二维数组
今天在BBS里面看到这样的面试题目,
1,二维数组(N*N),沿对角线方向,从右上角打印到左下角如N=4: 4*4二维数组
{ 1 2 3 4 }
{ 5 6 7 8 }
{ 9 10 11 12 }
{13 14 15 16 }
打印顺序
4
3 8
2 7 12
1 6 11 16
5 10 15
9 14
13
要
Ehcache(08)——可阻塞的Cache——BlockingCache
234390216
并发 ehcache BlockingCache 阻塞
可阻塞的Cache—BlockingCache
在上一节我们提到了显示使用Ehcache锁的问题,其实我们还可以隐式的来使用Ehcache的锁,那就是通过BlockingCache。BlockingCache是Ehcache的一个封装类,可以让我们对Ehcache进行并发操作。其内部的锁机制是使用的net.
mysqldiff对数据库间进行差异比较
jackyrong
mysqld
mysqldiff该工具是官方mysql-utilities工具集的一个脚本,可以用来对比不同数据库之间的表结构,或者同个数据库间的表结构
如果在windows下,直接下载mysql-utilities安装就可以了,然后运行后,会跑到命令行下:
1) 基本用法
mysqldiff --server1=admin:12345
spring data jpa 方法中可用的关键字
lawrence.li
java spring
spring data jpa 支持以方法名进行查询/删除/统计。
查询的关键字为find
删除的关键字为delete/remove (>=1.7.x)
统计的关键字为count (>=1.7.x)
修改需要使用@Modifying注解
@Modifying
@Query("update User u set u.firstna
Spring的ModelAndView类
nicegege
spring
项目中controller的方法跳转的到ModelAndView类,一直很好奇spring怎么实现的?
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* yo
搭建 CentOS 6 服务器(13) - rsync、Amanda
rensanning
centos
(一)rsync
Server端
# yum install rsync
# vi /etc/xinetd.d/rsync
service rsync
{
disable = no
flags = IPv6
socket_type = stream
wait
Learn Nodejs 02
toknowme
nodejs
(1)npm是什么
npm is the package manager for node
官方网站:https://www.npmjs.com/
npm上有很多优秀的nodejs包,来解决常见的一些问题,比如用node-mysql,就可以方便通过nodejs链接到mysql,进行数据库的操作
在开发过程往往会需要用到其他的包,使用npm就可以下载这些包来供程序调用
&nb
Spring MVC 拦截器
xp9802
spring mvc
Controller层的拦截器继承于HandlerInterceptorAdapter
HandlerInterceptorAdapter.java 1 public abstract class HandlerInterceptorAdapter implements HandlerIntercep