如何使用Geb使元素可见? [英] How to make an element visible using Geb?
本文介绍了如何使用Geb使元素可见?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个类别为"popup"的元素,我希望在功能测试期间使其可见.以编程方式使该元素可见的最佳方法是什么?我正在使用Geb进行功能测试.
I have an element with class "popup", which i want to make visible during a functional test. What is the best way to programmatically make the element visible? I am using Geb for functional testing.
推荐答案
如果在网页中使用Jquery.您可以使用jquery的"show"方法将可见元素变为可见元素.代码看起来像这样
If you use Jquery in your web pages. You could use jquery "show" method to make visible an invisible element. The code would look like this
$(".popup", 0).jquery.show();
注意:根据文档,仅当您正在使用的页面包括jQuery时,jQuery集成才有效,而Geb不会为您安装该页面.
Note : As per documentation, the jQuery integration only works when the pages you are working with include jQuery, Geb does not install it in the page for you.
这篇关于如何使用Geb使元素可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文