51Testing软件测试论坛

标题: 关于通配符的问题 [打印本页]

作者: daluyan    时间: 2004-11-18 14:59
标题: 关于通配符的问题
set_window ("*.txt - 记事本", 5);
在论坛的其他地方,我看到关于通配符的用法,使用{}扩起来的,可在winrunner中不可以,我试了其它很多还是不可以。
作者: QA_BAY    时间: 2004-11-18 15:14
不好意思现在改过来了!



set_window ("!.*", 5);
就是当出现对像变认时,
你就可以点EDIT,然后改成上面那样

[ Last edited by QA_BAY on 2004-11-18 at 20:40 ]
作者: 生如火花    时间: 2004-11-18 16:08
是!.*,在TSL语句中不能用,用于GUI对象
作者: shyfish    时间: 2004-11-19 13:23
!.*在GUI里面也会报错的吧?必须在!.*后面或者在!和.*之间加一些参照的符号
如果要找任意的非空字符串,用这个:!..*(直接使用,不必再加其它相对的参照字符),在WR自带的例子里面发现的,能够匹配任意的字符串(非空)
还有一种使用方法:!.*g.*,即只要字符串中含有g字母就匹配
其实不用这么费力去研究,WR的Run Wizard会自动帮忙修改的
作者: QA_BAY    时间: 2004-11-19 13:31
是阿,Run Wizard会帮你改,
如果你认错时他就不会了,(当你不太肯定是哪个控件时)
需要你自己去改!
你上面说的那几种都很好
只是没有多加注意!


As I know, sometimes the obj's physical description changed as well, such as "{
class: window,
MSW_class: browser_main_window,
NSTitle: "Browser Main Window"
}" change to "{
class: window,
MSW_class: browser_main_window,
NSTitle: "Browser Main Window",
location: 0
}"

If this happen, "!.*" will not work. Currently I added switch/if/... in my scripts, but don't think is a good solution.


Actually if there are more than one window. Winrunner will show object description in above format adding extra parameter "location".

To resolve this issue...if you know that which(No.) window you are trying to interact then for physical description you can use that respective no. then it will work fine.

If you think it is not possible to know the no. of IE browsers open then you can use "getparent" function for getting the actual parent window and carry on your testing irrespective of any no. of windows

相信这里些话已经说得很清楚了!

[ Last edited by QA_BAY on 2004-11-19 at 14:04 ]
作者: steven0607    时间: 2005-5-25 17:27
Originally posted by 生如火花 at 2004-11-18 16:08:
是!.*,在TSL语句中不能用,用于GUI对象


那么,在TSL语句中,怎样使用通配符???




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2