想象一下我有一个像这样的图像:
the_image = @browser.image(:id, 'image01')
获取其类值的方法可能是:
image_status = the_image.attribute_value('class')
行。我正在使用 page_object gem,假设我将图像作为元素,例如:
image(:the_image, :id => 'image01')
要获取属性值,我可以使用:
image_status = the_image_element.attribute_value('class')
...但我收到了弃用警告:
*** DEPRECATION WARNING
*** You are calling a method named attribute_value at page.rb:68:in `get_status'.
*** This method does not exist in page-object so it is being passed to the driver.
*** This feature will be removed in the near future.
如何class
使用 page_object 元素获取值?当然答案很简单,但我没有找到。你能告诉我路吗?
先感谢您!