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)?