当前位置:网站首页>Selenium: JS operation
Selenium: JS operation
2022-08-01 05:10:00 【Mouse A who is not afraid of cats】
JavaScript
1. JavaScript is the programming language of the Web, and all modern HTML pages will use JavaScriptp>
2. A complete web page is composed of HTML, CSS, JavaScript, etc.
⑴HTML: equivalent to the skeleton, which determines the basic structure of the web page
⑵CSS: equivalent to the performance, determines the presentation form of the web page
⑶JavaScript: equivalent to action, determines what the web page can do
3. Compare a webpage to a person
⑴HTML is the person's skeleton (determines the person's frame)
⑵CSS is the person's skin, hair, etc. (determines the person's appearance)
⑶ JavaScript is the action of this person (raise hand, kick, etc.)
Operating JS in Selenium
1. WebDriver simulates the operation of end users, that is to say, the operation (actual operation) that the user can complete under normal circumstances can be simulated through the API provided by WebDriver
2, but in actual WEB applications, not all elements can be operated by users, so using WebDriver can not directly simulate operations; or WebDriver does not provide interface methods for corresponding operations
⑴ Elements are written in JSThe
⑵ Element is invisible
⑶ Element cannot be clicked
⑷ Modify element attributes (WebDriver does not provide the corresponding interface method)
⑸ Browser scroll bar (WebDriver does not provide the corresponding interfacemethod)
3. In these cases, we can execute JavaScript code through WebDriver to achieve the purpose of manipulating (clicking or executing) elements
⑴ Execute JavaScript statements through WebDriver to interact with JavaScript in Web pages.So what JavaScript can do, Se
边栏推荐
猜你喜欢

II. Binary tree to Offer 68 - recent common ancestor

pytroch、tensorflow对比学习—功能组件(数据管道、回调函数、特征列处理)

备战金九银十,如何顺利通过互联网大厂Android的笔面试?

WPF入门项目必知必会-初步了解数据绑定 binding

state compressed dp

Pyspark Machine Learning: Vectors and Common Operations

What should I do if the neural network cannot be trained?

状态压缩dp

I met a shell script

pytroch、tensorflow对比学习—搭建模型范式(构建模型方法、训练模型范式)
随机推荐
剑指 Offer 68 - II. 二叉树的最近公共祖先
LeetCode 27. 移除元素
中国的机器人增长
2022年湖南工学院ACM集训第六次周测题解
请问shake数据库中为什么读取100个collection 后,直接就退出了,不继续读了呢?
MySQL Practice Summary -
Robot_Framework:断言
DL-31/6电流继电器
[MySQL] 多表查询
关于给Qt做一个软件初始化的进度条
pytroch、tensorflow对比学习—搭建模型范式(低阶、中阶、高阶API示例)
The method of solving stored procedure table name passing through variable in mysql
typescript24-类型推论
typescript24 - type inference
PAT class B 1001 (3n+1) conjecture
PaddleX部署推理模型和GUI界面测试结果不一致的解决方法
Selenium:元素等待
typescript27 - what about enumeration types
Selenium:元素定位
Challenge 52 days to memorize Peppa Pig (Day 01)