简体   繁体   English

Telerik测试框架-提交没有提交按钮的HTML表单

[英]Telerik Testing Framework - Submitting an HTML Form without a Submit Button

With the SHDocVw.InternetExplorer class you can do things like InternetExplorer.Document.Forms.FormName.Submit() and have a form submit without an actual submit button. 使用SHDocVw.InternetExplorer类,您可以执行InternetExplorer.Document.Forms.FormName.Submit()之类的操作,并且无需实际提交按钮即可提交表单。

How can I replicate this behavior with the Testing Framework? 如何使用测试框架复制此行为?

I can grab the form into an HTMLForm variable, but cannot figure out how to submit it. 我可以将表单获取到HTMLForm变量中,但无法弄清楚如何提交它。

For example: 例如:

<FORM style="POSITION: absolute; DISPLAY: none" id=frmRootDocument method=post action=controller.aspx target=appContentFrame>

The site is not public, so that's the best I can do. 该网站不是公开的,所以这是我能做的最好的事情。

Thanks. 谢谢。

got around it like this: 这样绕开它:

Dim script As String =
"var element=document.getElementById('MYFORM');"
"var input=document.createElement('input');"
"input.type='submit';"
"input.setAttribute('id', 'submit');"
"element.appendChild(input);"

scraper.Actions.InvokeScript(script)

Dim submit As Element = scraper.find.byid("submit")
scraper.Actions.Click(submit)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM