2016-12-22 22 views
1

我需要使用AutoIt更改Internet Explorer中的仿真模式。如何使用AutoIt設置Internet Explorer選項?

基本上我需要打開「開發者工具」(F12),更改文檔模式,可模擬IE 10

的AutoIt啓動並在我的IDE(Eclipse中)上運行。我已經可以打開IE,我有什麼疑問:

  1. 我該如何模擬打開調試選項?

enter image description here

  • 我怎樣才能改變仿真版本?
  • enter image description here

    我剛剛創建的AutoIt的一個新實例,並知道如何打開IE:

    package autotioficial; 
    
    import java.io.File; 
    
    import com.jacob.com.LibraryLoader; 
    
    import autoitx4java.AutoItX; 
    
    public class App { 
    
    public static void main(String[] args) { 
    
        File file = new File("lib", "jacob-1.18-x86.dll"); //path to the jacob dll 
        System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath()); 
    
        AutoItX x = new AutoItX(); 
        x.run("C:/Program Files (x86)/Internet Explorer/iexplore.exe"); 
    
        } 
    
    } 
    

    請,我明白任何形式的幫助。謝謝 !

    回答

    0

    我會使用按鍵來做到這一點:

    x.send("{F12}") //go to developer mode 
    x.send("^8") //control-8 to go to Emulation tab 
    x.send("{TAB}") //select the first field (Document mode) 
    x.send("10") //set emulated version to E10 
    

    我手動檢查,這適用於瀏覽器11的變化雖然不是很執着,留意瀏覽器歷史記錄重置等(http://appliedusers.ca/forums/index.php?topic=5330.0)。

    參考文獻:
    https://www.autoitscript.com/autoit3/docs/functions/Send.htm
    https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm

    +0

    Bookeater,謝謝回答的問題是,如何在點擊該選項,在我用鼠標... –

    +0

    @Leonardo萊昂納多點擊PRINTSCREEN,所以按F12後沒有選擇選項? (x.send(「{F12}」)) – Bookeater

    +0

    不,不行,不知道爲什麼。 –

    相關問題