Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99410

Javascript execution for typing in text field is not behaving as sendKeys

$
0
0

I'm running my tests on Linux machine and there with following code, it does not type text correctly -

visibleElement.clear();
visibleElement.sendKeys("I am running on linux machine");

In UI, actually different text gets typed in like - "on linux machine I am running", "running on linux machine I am" etc

hence to handle this, I used javascript like -

JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("arguments[0].value='I am running on linux machine';", visibleElement);

This types text as it is in text field, but after typing this, there is Save button which is expected to be enabled but that is not enabled.

But that button is enabled if sendKeys is used.

Could you please let me know why this javascript is behaving differently and provide correct javascript?

How both things will work in single solution(without hitting tab to enable button because that is not correct way in my situation)?


Viewing all articles
Browse latest Browse all 99410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>