title: Firefox C# Selenium Can't set a value using sendKeys and JavaExecutor doesn't seem to be affecting it
body: <p><strong>Hi all,</strong></p>
  <p>Bit of a conundrum here for me, been at it a while to get past this issue but am just seemingly stuck.
  I am trying to write an automation strategy for a Trading Platform (In this case Trading212) and attempting to use C# with Selenium in order to do so.</p>
  <p>All was going fine until I got to the overlay that deals with Placing an order.
  Much like normal I tried sendKeys but that responded badly with all attempts:</p>
  <h1>Errors</h1>
  <p>-Error ElementNotInteractableException (Can't be scrolled into view)<br />
  -Error ElementNotInteractableException (Element is not reachable by keyboard)<br />
  -js.ExecuteScript(&quot;arguments[0].value='12345';&quot;, TargetPriceInput); (Changes a value just not the value)</p>
  <p>The bit I'm trying to adjust is the Price which apparantly can not be modified from any way I can find and it was hard enough to select as it has a dynamically changing ID, no class to hang on to was only able to get it by finding an input with &quot;Text&quot;.</p>
  <h1>Element I am trying to update:</h1>
  <pre><code>    &lt;div class=&quot;spinner _focusable&quot; tabindex=&quot;-1&quot; data-dojo-attach-event=&quot;onkeydown: onKeyDown&quot; id=&quot;uniqName_0_131&quot; widgetid=&quot;uniqName_0_131&quot;&gt;
          &lt;span class=&quot;spinner-placeholder&quot; data-dojo-attach-point=&quot;placeholderNode&quot;&gt;Price&lt;/span&gt;
          &lt;input type=&quot;text&quot; autocomplete=&quot;off&quot; id=&quot;uniqName_0_132&quot; widgetid=&quot;uniqName_0_132&quot;&gt;
          &lt;div class=&quot;spinner-arrow-container&quot;&gt;
              &lt;div class=&quot;spinner-arrow spinner-down svg-icon-holder&quot; data-dojo-attach-point=&quot;spnLeftNode&quot;&gt;&lt;svg class=&quot;svg-icon dropdown-arrow-down-icon&quot; width=&quot;32&quot; height=&quot;32&quot; viewBox=&quot;0 0 32 32&quot;&gt;
          &lt;g fill=&quot;none&quot; fill-rule=&quot;evenodd&quot;&gt;
              &lt;polyline stroke=&quot;#6F6F7F&quot; points=&quot;20.5 14.5 16 19 11.5 14.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/polyline&gt;
          &lt;/g&gt;
      &lt;/svg&gt;
      &lt;/div&gt;
              &lt;div class=&quot;spinner-arrow spinner-up svg-icon-holder&quot; data-dojo-attach-point=&quot;spnRightNode&quot;&gt;&lt;svg class=&quot;svg-icon dropdown-arrow-up-icon&quot; width=&quot;32&quot; height=&quot;32&quot; viewBox=&quot;0 0 32 32&quot;&gt;
        &lt;g fill=&quot;none&quot; fill-rule=&quot;evenodd&quot;&gt;
          &lt;polyline stroke=&quot;#6F6F7F&quot; points=&quot;20.5 18.5 16 14 11.5 18.5&quot; stroke-linecap=&quot;round&quot;&gt;&lt;/polyline&gt;
        &lt;/g&gt;
      &lt;/svg&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class=&quot;spinner-disabled-click-catcher&quot; data-dojo-attach-point=&quot;clickCatcherNode&quot;&gt;&lt;/div&gt;
      &lt;/div&gt;
  
  </code></pre>
  <p>It seems like it is tied with Javascript to update when a key is pressed and the box is selected but I can't seem to get selenium to select the box nor push data into it.
  There are events tied to the input box but can't seem to find a way to make it go.</p>
  <pre><code>                    TargetPrice.Click();
                      TargetPrice.SendKeys(&quot;05485.00000&quot;);
  </code></pre>
  <p>Both just give errors and refuse to do the job.
  <a href="https://i.stack.imgur.com/Mlpnl.png" rel="nofollow noreferrer">original look of the panel</a></p>
  <p>Firefox Inspector also shows me the value of the Element is indeed a string like value: &quot;1.31407&quot; which is hidden but I definitely was able to update with ExecuteScript but it is not Validating it.
  I can see the value is updated but when I click anywhere else it just gets dumped.</p>
  <p>Looking into it further it seems there are some scripts probably JavaScript that manually evaluate what buttons I am pressing and resolve it. Not sure how to get around that.</p>
  <h1>Event OnKeyDown</h1>
  <pre><code>function, o = i.checkIntegerPartLength, s = i.onKeyPressed, l = this.state, d = l.currentValue, u = l.maxInputLength, h = this.getPrecision(), f = !1;
  for (var p in r.default)
    if (void 0 === v[p] &amp;&amp; r.default[p] === t.keyCode) {
      f = !0;
      break
    }(t.altKey || 18 === t.keyCode) &amp;&amp; (t.stopPropagation(), t.preventDefault());
  var g = String.fromCharCode(t.keyCode);
  !f &amp;&amp; isNaN(parseInt(g, 10)) &amp;&amp; 190 != t.keyCode &amp;&amp; 110 != t.keyCode &amp;&amp; 109 != t.keyCode &amp;&amp; 189 != t.keyCode &amp;&amp; (t.stopPropagation(), t.preventDefault()), 190 != t.keyCode &amp;&amp; 110 != t.keyCode || 0 != h &amp;&amp; -1 === this.domNode.value.indexOf(&quot;.&quot;) || (t.stopPropagation(), t.preventDefault()), 189 != t.keyCode &amp;&amp; 109 != t.keyCode || (this.onMinusPress(), t.stopPropagation(), t.preventDefault()), t.shiftKey &amp;&amp; !isNaN(parseInt(g, 10)) &amp;&amp; (t.stopPropagation(), t.preventDefault());
  var m = (g = t.keyCode || t.charCode) == r.default.HOME || g == r.default.END || g == r.default.DELETE || g == r.default.BACKSPACE || g &gt;= 37 &amp;&amp; g &lt;= 40;
  if (!m &amp;&amp; !o &amp;&amp; c.default.getLength(this.domNode.value.replace(/\s/g, &quot;&quot;)) &gt;= u + h &amp;&amp; this.domNode.selectionStart == this.domNode.selectionEnd &amp;&amp; t.preventDefault(), !(a || t.keyCode !== r.default.NUMPAD_0 &amp;&amp; f)) {
    var C = this.domNode.value.split(&quot;.&quot;),
      y = n(C, 1)[0],
      b = 48 == t.keyCode || 96 == t.keyCode,
      w = this._getTextSelection(this.domNode),
      T = w.start,
      L = w.length,
      _ = this.domNode.value.length === L;
    0 === T &amp;&amp; &quot;.&quot; !== this.domNode.value.charAt(L) &amp;&amp; !_ &amp;&amp; y.length &amp;&amp; b &amp;&amp; t.preventDefault()
  }
  if (o &amp;&amp; !m &amp;&amp; 190 !== t.keyCode &amp;&amp; 110 !== t.keyCode) {
    var N = this.domNode.value.split(&quot;.&quot;),
      S = n(N, 2),
      E = S[0],
      I = S[1],
      x = this.domNode.value.indexOf(&quot;.&quot;),
      M = this._getTextSelection(this.domNode),
      O = M.start,
      P = M.length,
      A = E.substr(O, P),
      D = A &amp;&amp; (A.length &gt; 1 || 160 !== A.charCodeAt(0));
    E.replace(/\s/g, &quot;&quot;).length &gt;= u &amp;&amp; !D &amp;&amp; (!I &amp;&amp; -1 === x || O &lt;= x) &amp;&amp; t.preventDefault()
  }
  &quot;0&quot; != d || h || m || 48 != t.keyCode &amp;&amp; 96 != t.keyCode || t.preventDefault(), 65 == g &amp;&amp; t.ctrlKey &amp;&amp; this.domNode.select(), setTimeout((function() {
    e._destroyed || (s(), e.updateState(e.domNode.value, {
      isUserTyping: !0,
      keepCursorPosition: !0
    }))
  }), 5)
  }, onFocusEvent: function() {
      var t = this.props,
        e = t.o
  </code></pre>
  <p>Happy to provide as much details as needed. The page I'm dealing with is the demo webpage for trading212 so freely publically accessible if you happen to know how to make it go.</p>
  <p>Tried already to do virtual keystrokes using a separate library but even windows based seem to not be getting picked up weirdly.</p>
  <p>EDIT: After a long hard look and some decent retesting using the XPath system advised in the answer below I managed to find out that the reason none of it made sense if because despite my best efforts the Element being attempted to be modified was NOT the correct one but a similar one.</p>
  <p>To resolve even if in a temporary way I went into firefox inspected, selected the target input field and right clicked, then I clicked to copy -&gt; XPath.</p>
  <p>This gave me a direct route to the correct XPath.<br />
  <code>IWebElement XPathInput = driver.FindElement(By.XPath(&quot;/html/body/div[7]/div[2]/div[3]/div[2]/div[1]/div[3]/div/div[2]/div/input&quot;));</code></p>