Selenium / Protractor是否在当前加载的页面中查找元素?(Does Selenium/Protractor look for element in current loaded pa

编程入门 行业动态 更新时间:2024-10-28 20:24:52
Selenium / Protractor是否在当前加载的页面中查找元素?(Does Selenium/Protractor look for element in current loaded page?)

Selenium / Protractor是否在当前加载的页面中查找元素,或者在为相同元素使用相同的Css选择器时查看整个应用程序?

例如:

在客户表单上保存按钮class="save"

供应商保存按钮表格class="save"

Does Selenium/Protractor look for element in current loaded page, or look in the entire application when using the same Css Selector for same elements?

Eg:

Save Button on Customers Form class="save"

Save Button on Vendors Form class="save"

最满意答案

量角器通过与浏览器交互(通过selenium)工作。 Selenium使用浏览器驱动程序与您的页面进行交互,浏览器仅包含它要求的代码(根据所请求的类型从服务器返回)。

所以是的, 它只查找当前加载页面中的元素 。 它无法访问您的整个应用程序代码。

Protractor works by interacting with the browser (via selenium). Selenium uses browser drivers to interact with your page, and the browser only contains the code that it asked for (returned from the server, based on the type of request that was made).

So yes, it only looks for elements in the currently loaded page. It has no access to your entire application code.

更多推荐

本文发布于:2023-07-27 14:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1291658.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   元素   页面   Protractor   Selenium

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!