有什么之间的区别是present和isDisplayed方法 [英] What is the difference between the isPresent and isDisplayed methods

查看:733
本文介绍了有什么之间的区别是present和isDisplayed方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始用量角器编写测试。我想知道的区别是什么为present() isDisplayed()方法之间。

I just started using Protractor to write tests. I am wondering what the difference is between the isPresent() and isDisplayed() methods.

的API定义


  1. 是present

isDisplayed

所以......在何种情况下有不同?

So... in what cases are they different?

推荐答案

为present 如果在一个页面中存在元素(DOM)是真实的,但可以隐藏(显示:无在CSS)
isDisplayed 是真的只有当为present 是真实的的元素是可见的。

isPresent is true if element exists in a page (in DOM), but can be hidden (display: none in css) isDisplayed is true only if isPresent is true and element is visible

这篇关于有什么之间的区别是present和isDisplayed方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆