florentbr / SeleniumBasic

A Selenium based browser automation framework for VB.Net, VBA and VBScript
BSD 3-Clause "New" or "Revised" License
422 stars 197 forks source link

Fill In Hidden field #12

Closed jjmanthei05 closed 9 years ago

jjmanthei05 commented 9 years ago

What syntax would I use to fill in the following field? I tried the sendkeys but that fails because it's hidden. Sorry if this is the wrong spot for the question.

Thanks,

Jason

florentbr commented 9 years ago

I wouldn'd recommend to use an hidden field as there's probably some underlying merchanisme attached to it. You should try to emulate as close as possible what a real user would do. Now if you are still determined, it's relatively easy to inject some javascrit:

Dim driver As New FirefoxDriver
driver.Get "https://www.google.co.uk"
driver.FindElementByName("q").ExecuteScript _
    "this.value=arguments[0];", "my value"