![sikuli常見問題解決ppt課件_第1頁](http://file3.renrendoc.com/fileroot3/2021-9/12/39258ef4-01dd-48f2-aa6d-f4d289896c3e/39258ef4-01dd-48f2-aa6d-f4d289896c3e1.gif)
![sikuli常見問題解決ppt課件_第2頁](http://file3.renrendoc.com/fileroot3/2021-9/12/39258ef4-01dd-48f2-aa6d-f4d289896c3e/39258ef4-01dd-48f2-aa6d-f4d289896c3e2.gif)
![sikuli常見問題解決ppt課件_第3頁](http://file3.renrendoc.com/fileroot3/2021-9/12/39258ef4-01dd-48f2-aa6d-f4d289896c3e/39258ef4-01dd-48f2-aa6d-f4d289896c3e3.gif)
![sikuli常見問題解決ppt課件_第4頁](http://file3.renrendoc.com/fileroot3/2021-9/12/39258ef4-01dd-48f2-aa6d-f4d289896c3e/39258ef4-01dd-48f2-aa6d-f4d289896c3e4.gif)
![sikuli常見問題解決ppt課件_第5頁](http://file3.renrendoc.com/fileroot3/2021-9/12/39258ef4-01dd-48f2-aa6d-f4d289896c3e/39258ef4-01dd-48f2-aa6d-f4d289896c3e5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Sikuli常見問題.常見問題 如何實現(xiàn)拖拽 如何操作下拉列表框 如何在腳本中運用中文 如何在log中顯示日期 如何將數(shù)字轉(zhuǎn)換成字符串 如何定義全局變量 Sikuli打不開怎樣辦. 如何更改匹配相識度 如何指定一個相對位置并點擊 如何設(shè)置鼠標挪動延遲 如何等待一個圖像的出現(xiàn) 如何獲得一個圖像的坐標.如何實現(xiàn)拖拽 ip = App(iPhone Simulator)ip.focus()ipw = ip.window()#ipw.highlight(2)bottom = 1318343141834.png # see commentmBottom = ipw.find(bottom)p = mBo
2、ttom.getTopLeft().above(10).right(15)hover(p)mouseDown(Button.LEFT)mouseMove(p.above(100)mouseUp(). while not ipw.exists (image-of-delete-button, 0): hover(p) mouseDown(Button.LEFT) mouseMove(p.above(100) # choose your stepping mouseUp() wait(1)click(ipw.getLastMatch() # should click delete button.
3、The only modification needed is to use below instead of downx1, y1, x2, y2 = (100, 100, 500, 600)start = Location(x1, y1)end = Location(x2, y2)stepX = 10 # adjust this as neededstepY = int(y2-y1)/(x2-x1)/stepX)run = startmouseMove(start); wait(0.5)mouseDown(Button.LEFT); wait(0.5)while run.getX() en
4、d.getX():run = run.right(stepX).below(stepY) # use below instead of downmouseMove(run)mouseMove(end)mouseUp().如何操作下拉列表框 switchApp(Safari)dd = find( )if dd: click(dd) # opens list sleep(0.5) # to avoid timing problems type(Key.DOWN) # here goes your navigation type(Key.ENTER)else: popup(Sorry, no dro
5、pdown found). you may find, that your dropdown entry is found even if the content is not exactly, what the image says.To test different situations, produce these situations and then use preview (click on the image in the IDE). Play around with the similarity slider. if you click ok, your image is tu
6、rned into a pattern object (pattern(image).similar(decimal between 0 and 1). You can use it directly (use instead of find():find(Pattern().similar(0.8) # the standard in the moment is 0.73this means: only find images with a similarity of at least 0.8This helped in the example to assure, that the dro
7、pdown was only clicked when showing: by relevancy.如何在腳本中運用漢字 請參考/dev/peps/pep-0263/ 處理方案: 在腳本文件的前面添加如下代碼: #!/user/bin/python # -*- coding: utf-8 -*- 必需放在腳本文件的第一行,試過.如何在log中顯示日期 處理方案: import datetime now = datetime.datetime.now() print now.strftime(%Y-%m-%d %H:%M:%S).如何將數(shù)字轉(zhuǎn)換成字符串 參考httpi
8、pseek.blog.51cto/1041109/788166 處理方案: str(數(shù)字).如何定義全局變量python有全變量,普通跟c里面是一樣的 bar = pythondef foo1(): bar = hello # 這里是部分變量 print(bar) # 打出hello,并且不會影響全局變量bar全局那個bar依然是python def foo2(): print(bar) # 打出python # 由于沒有聲明部分變量所以python會搜索全局的bar,這個bar是全局的 def foo3(): global bar # 通知python下面的bar是全局的bar = hell
9、o # 這里是全局變量 print(bar) # 打出hello,全局的bar曾經(jīng)改為hello不再是python了處理方案:在函數(shù)外面定義變量,然后在函數(shù)體內(nèi)用global聲明后在運用 .Sikuli打不開咋辦 參考 處理方案: On windows: Use Sikuli-IDE.bat to start sikuli Before delete the registry branch HKEY_CURRENT_USERSoftwareJavaSoftPrefsorgsikuliide.如何更改匹配相識度 參考/docx/globals.html#control
10、ling-sikuli-scripts-and-their-behavior 處理方案: Settings.MinSimilarity=小于1的數(shù)字 默許0.7.如何指定一個相對的位置,并點擊 參考 (Extending a Region) /docx/region.html#creating-a-region-setting-and-getting-attributes 處理方案: location =find(ii-1.png).right(50) hover(location) mouseDown(Button.LEFT) mouseUp(Button.LEFT) 或
11、者 Location=Pattern(“ii-1.png).targetOffset(100,0)參考/docx/pattern.html.如何設(shè)置鼠標挪動延遲 參考/docx/globals.html#controlling-sikuli-scripts-and-their-behavior 處理方案: Settings.MoveMouseDelay=數(shù)值 以s為單位,默以為0.5s.如何等待一個圖像的出現(xiàn)參考 img1 and img2 contain valid image filenamesweWait = 20 # max se
12、conds we want to waitwhile weWait 0: mImg1 = exists(img1,0) # see comment mImg2 = exists(img2,0) if mImg1 or mImg2: break # leave the loop if at least one found wait(1) weWait -= 1 # count down wait timeif not (mImg1 and mImg2): print images did not appear; exit(1)if mImg1: print image 1 appearedif
13、mImg2: print image 2 appeared- commentexists(img,0) does only one search and does not wait the standard 3 seconds, if image is not found. So for timing purposes you can calculate 0.5 seconds for every exists. So in your case it will last about 25 to 30 seconds, if n one of the images appears. So if 20 seconds is what you want, set weWait to an appropriate lower value
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 中介服務(wù)協(xié)議合同
- 物流貨運服務(wù)合同
- 2025年上海道路客貨運輸從業(yè)資格證b2考試題庫
- 2025年廣西貨運從業(yè)資格證500道題目和答案大全
- 2025年山西貨運從業(yè)資格證模擬考試0題答案解析
- 電力供應保障合同(2篇)
- 2024-2025學年高中英語Unit16Stories模擬高考強化練含解析北師大版選修6
- 教師個人培訓總結(jié)報告
- 物業(yè)公司安全隱患排查大總結(jié)
- 品質(zhì)部年度工作計劃
- 灌腸操作評分標準
- 企業(yè)年金基金管理機構(gòu)基本服務(wù)和收費標準規(guī)范規(guī)范行業(yè)自律公約
- 小學二年級部編人教版上冊語文期末整理復習題
- 東華醫(yī)院麻醉科QoR-40隨訪表
- DB5106∕T 16-2021 機插水稻育秧基質(zhì)制備技術(shù)規(guī)程
- 堤壩工程施工組織設(shè)計
- 常用鋼材化學成分及力學性能
- CPIM BSCM__v3_0_VC(課堂PPT)
- 常用的螺紋底孔及公差規(guī)定
- 雀巢面試的開放性問題
- 會議審批表模板
評論
0/150
提交評論