سؤال

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)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top