2016-05-25 72 views
0

使用iMacro(Chrome擴展),我想自動化網站上的動作:iMacro:測試結果URL

  1. 檢查一個複選框(條件)
  2. 點擊按鈕(提交)
  3. 然後將得到的URL比較字符串

    如果屬實==>重新啓動腳本從開始
    如有虛假==>顯示彈出消息(或其他任何警報用戶)

我從這裏開始錄製步驟1和2的正常工作,並且可以在循環運行

VERSION BUILD=8350307 RECORDER=CR 
URL GOTO=http://websitew.com/5421/0 
REFRESH 
TAG POS=1 TYPE=A ATTR=HREF:http://websitew.com/5421/0# 
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:FormBookingCreate ATTR=ID:condition CONTENT=YES 
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:FormBookingCreate ATTR=NAME:nextButton 
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:FormBookingCreate ATTR=NAME:finishButton 

而且之後,它不接受如果的語句,我不知道如何與某種的消息框通知用戶或提醒

SET current {{!URLCURRENT}} 

#if current = "http://websitew.com/5421/0" then 
MsgBox "OK!" 
else 
    """start from the beginning """ 

回答

1

嘗試對Chrome的iMacros的「推廣此解決方案:

' here your code with the 1st and 2nd steps ' 

SET S EVAL("('{{!URLCURRENT}}' == 'http://websitew.com/5421/0') ? 'alert(\"OK!\");' : 'undefined';") 
URL GOTO=javascript:{{S}} 

' uncomment the line below to stop your macro after a message box ' 
'SET E EVAL("('{{S}}' == 'undefined') ? '' : MacroError('STOP!');") 
+0

謝謝Shugar。它完成這項工作。現在我有一個很好的開始學習更多。 – AJN