1

I am having issues with chromedp.Clear()

I am succesfully able to fill the below input with:

chromedp.SendKeys(`input[name="TESTFIELD"]`, "new value", chromedp.ByQuery)

But clearing it first with:

chromedp.Clear(`input[name="TESTFIELD"]`, chromedp.ByQuery)

A snippet of the HTML:

<input type="text" name="TESTFIELD" size="30"  maxlength="30"  value=""  class="cssKenmerkNoLookup"  valign="middle" onfocus=fnFieldChanged(this,1,0); onchange="fnSetDirty('cmdOK,cmdOKNext,cmdOKInvoeren,cmdStartMITOffice');" onkeydown="fnCheckForEdit('cmdOK,cmdOKNext,cmdOKInvoeren,cmdStartMITOffice', 'TESTFIELD',1);" onkeyup="fnCheckForEdit('cmdOK,cmdOKNext,cmdOKInvoeren,cmdStartMITOffice', 'TESTFIELD',0);" onpaste="fnCheckForEdit('cmdOK,cmdOKNext,cmdOKInvoeren,cmdStartMITOffice', 'TESTFIELD',0);" >
</td><td align="center" valign="middle"  class="cssCellDetailsColLookup"  nowrap >

I cant use the class, cssKenmerkNoLookup, since the same class is used with multiple inputs, so that is why I use "ByQuery"

What am I overlooking?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
snowbird
  • 93
  • 1
  • 8

1 Answers1

2

Issue solved.

by using:

chromedp.SetValue(selector, value, chromedp.ByQuery),

Current input value is replaced.

snowbird
  • 93
  • 1
  • 8