简体   繁体   中英

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.

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.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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