编写脚本,出现 TypeError: exceptions must be old-style classes or derived from BaseException, not unicode怎样解决?

  小编使用robot framework,在编写安卓自动化脚本时,出现这样的情况:

  在网上搜了好久,发现都是python的解决方法,到底怎样解决robot里面的问题呢?最终发现:

  (1)代码中我是这样写的:

1 Click Button                   ${BACK_TO_HOMEPAGE}

  (2)查看uiautoviewer中,发现这个控件是imageview,并不是个button;

  (3)所以,代码就需要改成:

1 Click Element                   ${BACK_TO_HOMEPAGE}

  注:在编写安卓自动化脚本时,最好使用click element,分不清button就会造成失败

  

  

posted @ 2017-11-27 14:39  Yi个人  阅读(3155)  评论(0编辑  收藏  举报