1. 程式人生 > >selenium中SimplePropertyDescriptor的用法

selenium中SimplePropertyDescriptor的用法

 

定義一個SimplePropertyDescriptor類物件

SimplePropertyDescriptor simplePropertyDescriptor = new SimplePropertyDescriptor("name", read, write);

其中name作為物件的名字,read是Function<Object,Object>物件,write是Method物件。我用的是3.141.59版selenium,read和write在SimplePropertyDescriptor中沒有意義。SimplePropertyDescriptor simplePropertyDescriptor這個類不是用來定義的,是用來獲取的。

最重要的是getPropertyDescriptors(Class<?> clazz)這個方法,這個方法是獲取clazz類中的引數的方法。返回型別就是SimplePropertyDescriptor.