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.
更多推荐
发布评论