首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

请问模拟点击

2012-02-26 
请教模拟点击test.html代码:HTML codehtmlhead/headbodyiframe srcaa.html height200 widt

请教模拟点击
test.html代码:

HTML code
<html><head></head><body><iframe src="aa.html" height="200" width="400" frameborder="0"></iframe></body></html>


aa.html代码:
<BODY>
<FORM method=post action=tt.html>
<DIV id=ss>
<INPUT id=ddone name=dnone> 
<INPUT value=www type=submit>
</DIV>
</FORM>
</BODY>

使用webbrowser打开test.html网页,我想使用代码模拟点击内嵌框架里的www按钮,求代码

[解决办法]
用ID:
WebBrowser1.OleObject.document.getElementByID('ID').click;

无ID那就要知道是第几个按钮:
WebBrowser1.OleObject.document.getElementsByTagName('input').item(0).click;

[解决办法]
可以实现。不过你提供的网页根本不适合做测试用,因为点击按扭后并无反应,你要做个比如点按扭后打开一个alert对话框来方便测试。
[解决办法]
web.OleObject.Document.DocumentElement.Document.Frames.item(0).document.all.item(7).form.submit;
用这个可以点击的。
[解决办法]
或者
web.OleObject.Document.DocumentElement.Document.Frames.item(0).document.all.item(7).click;

热点排行