最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

silktest 技巧积累<一>

来源:懂视网 责编:小采 时间:2020-11-09 08:12:11
文档

silktest 技巧积累<一>

silktest 技巧积累<一>:Setting this option to FALSE suppresses control notresponding errors. 13. 等待鼠标状态。 [-] void WaitForMouseIdle(integeriTimeOut) [ ] integeriTime=1 [-]while(Cursor.GetType()==WA
推荐度:
导读silktest 技巧积累<一>:Setting this option to FALSE suppresses control notresponding errors. 13. 等待鼠标状态。 [-] void WaitForMouseIdle(integeriTimeOut) [ ] integeriTime=1 [-]while(Cursor.GetType()==WA

Setting this option to FALSE suppresses "control notresponding" errors. 13. 等待鼠标状态。 [-] void WaitForMouseIdle(integeriTimeOut) [ ] integeriTime=1 [-]while(Cursor.GetType()=="WAIT" || Cursor.GetType()=="DELAY" iTime iTimeOut) [ ] sle

Setting this option to FALSE suppresses "control not responding" errors.

13. 等待鼠标状态。

[-] void WaitForMouseIdle(integer iTimeOut)
[ ] integer iTime=1
[-] while(Cursor.GetType()=="WAIT" || Cursor.GetType()=="DELAY" && iTime < iTimeOut)
[ ] sleep(1)
[ ] iTime = iTime+5
[-] if(iTime > iTimeOut)
[ ] Log.Fail("Cursor status is not idle in {iTimeOut} seconds")
[ ] sleep(5)

14. 使用 ListRead()从一个文本中读取list变量,是一种数据驱动的好办法。

List of string lsFileContents

ListRead(lsFileContents,"C:\test.txt")

ListPrint(lsFileContents)

ListInsert (lsFile, i, lsNewInfo[i])

ListWrite (lsFile, "{GetProgramDir ()}\Sample.txt")

15. silktest 中使用递归实现清空文件夹内容方法:


[+] void glClearFolder(String filepath)
[+] //---------------------Log---------------------//
[ ] // Author : Cheers Li
[ ] // Date : 2009-09-15
[ ] //-----------------------------------------------//
[ ] filepath=Trim(filepath)
[+] if(SubStr(filepath,Len(filepath),1)=="")
[ ] filepath=SubStr(filepath,1,Len(filepath)-1)
[+] else
[ ] filepath=SubStr(filepath,1,Len(filepath))
[ ] String tempfilepath
[ ] String tmDir
[+] if(!SYS_DirExists(filepath))
[ ] RaiseError(13,"The path : {filepath} does not exists! ")
[ ] List of FILEINFO fFileContents=SYS_GetDirContents(filepath)
[-] FILEINFO item
[-] for each item in fFileContents
[ ] tempfilepath="{filepath}"+item.sName
[-] if(item.bIsDir)
[-] if(ListCount(SYS_GetDirContents(tempfilepath))==0)
[ ] SYS_RemoveDir(tempfilepath)
[-] else
[ ] glClearFolder(tempfilepath)
[ ] SYS_RemoveDir(tempfilepath)
[-] else
[ ] SYS_RemoveFile(tempfilepath)

16. Silktest 将 字符串转换成List of String 的方法

List of STRING lsConvertLineToList(String sLinfOfText)
//--------------------------------------Log---------------------------------
// Author : Cheers Li September 24, 2010
// Description: This function is for getting Strings of line, and convert it to a list.
[ ] String sTest=trim(sLinfOfText)
[ ] long ltemp
[ ] integer i,k=0
[ ] boolean blTemp
[ ] List of STRING lsTestString
[ ] ltemp=len(sTest)
[ ]
[+] for(i=1;i<=ltemp;i++)
[-] if(IsSpace(substr(sTest,i,1))==false)
[ ] k++
[ ] blTemp=false
[-] else
[-] if(blTemp==false)
[ ] ListAppend(lsTestString,substr(sTest,i-k,k))
[ ] blTemp=true
[ ] k=0
[ ] ListAppend(lsTestString,substr(sTest,i-k,k))
[ ]
[ ] return lsTestString

17. 通过api sendmessage()来关闭窗口。

[ ] use "msw32.inc"

[-] testcase testmenu() appstate none
[ ] wRefSYSMain.Invoke()
[ ] wRefSYSMain.SetActive()
[ ] SendMessage(wRefSYSMain.hWnd,WM_CLOSE,0,0)

文档

silktest&amp;nbsp;技巧积累&amp;lt;一&amp;gt;

silktest&nbsp;技巧积累&lt;一&gt;:Setting this option to FALSE suppresses control notresponding errors. 13. 等待鼠标状态。 [-] void WaitForMouseIdle(integeriTimeOut) [ ] integeriTime=1 [-]while(Cursor.GetType()==WA
推荐度:
标签: 技巧 积累 gt
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top