I am in need of running automated tests on a system. There are fields with validations that cannot be bypassed using the sendKeys
method alone. When I try it, only one string is written instead of the whole input. Attempting to iterate through sending keys didn't resolve the issue either.
Currently, I am experimenting with entering values into fields using JavaScript. This is what I have so far:
WebElement pesel = driver.findElement(fldPesel);
jse.executeScript("arguments[0].value='80120804076';", pesel);
However, my goal is to avoid hardcoding the value in executeScript and instead use a Java variable for better readability and functionality. I also want to introduce some randomization.
Any suggestions on how to achieve this?