Java 如何使用AutoIt设置Internet Explorer选项?
我需要使用AutoIt更改Internet Explorer中的仿真模式 基本上,我需要打开“开发者工具”(F12),更改文档模式以模拟IE10 AutoIt已在我的IDE(Eclipse)中启动并运行。我已经可以打开IE了,我有什么疑问:Java 如何使用AutoIt设置Internet Explorer选项?,java,eclipse,internet-explorer,automation,autoit,Java,Eclipse,Internet Explorer,Automation,Autoit,我需要使用AutoIt更改Internet Explorer中的仿真模式 基本上,我需要打开“开发者工具”(F12),更改文档模式以模拟IE10 AutoIt已在我的IDE(Eclipse)中启动并运行。我已经可以打开IE了,我有什么疑问: 如何模拟打开调试选项 如何更改仿真版本 我刚刚创建了AutoIt的一个新实例,并知道如何打开IE: package autotioficial; import java.io.File; import com.jacob.com.LibraryLoa
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");
}
}
我会使用按键来实现这一点:
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
我手动检查,这在Explorer 11上有效。不过,更改不是很持久,请注意浏览器历史记录重置等()
参考文献:我会用按键来实现这一点:
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
我手动检查,这在Explorer 11上有效。不过,更改不是很持久,请注意浏览器历史记录重置等()
参考文献:Bookeater,谢谢您的回答,问题是,如何在我用鼠标点击的打印屏幕中点击该选项…@Leonardo Leonardo,所以按F12后该选项未被选中?(x.send(“{F12}”))我添加了^8来选择仿真选项卡。现在它只需要激活您要查看的列表,然后发送(“10”)就可以了。@Leonardo Leonardo,进行了另一次编辑,手动对照E11进行了检查。Bookeater,感谢您的回答,问题是,如何在我用鼠标单击的打印屏幕中单击该选项…@Leonardo Leonardo,所以按F12后该选项未被选中?(x.send(“{F12}”))我添加了^8来选择仿真选项卡。现在,只需激活您要查找的列表,然后发送(“10”)即可。@Leonardo Leonardo进行了另一次编辑,并根据E11进行了手动检查。