python+selenium获取元素属性内容值用来断言

1、先定位到元素

a=driver.find_element_by_class_name('Select_text')

2、在使用方法get_attribute

a.get_attribute(参数)#该参数为属性名称

3、使用断言assertIn(a,b)断言

4、该方法可以获取input标签的value属性内容值

 

posted @ 2017-06-26 22:41  Ricardo_front  阅读(5117)  评论(0编辑  收藏  举报