citrusframework / yaks

YAKS is a platform to enable Cloud Native BDD testing on Kubernetes
Apache License 2.0
83 stars 27 forks source link

Selenium Input Step Extension #408

Open StefanFellinger opened 2 years ago

StefanFellinger commented 2 years ago

Consider to split SetInputAction from FindElementAction (maybe others too) and add clear behaviour for input fields.

I'm testing a a table where i need to scroll right so i can input some filter criteria for a column at the end of the table. I've found that FindElement throws an exception since the input element can not be accessed.

So my workaround is a customized SetInputAction that implements AbstractSeleniumAction:

 new Actions(driver).moveToElement(element).click().perform(); // move to that element
 element.sendKeys(Keys.CONTROL, "a"); // send clear input, so that browser events are published (refresh)
 element.sendKeys(Keys.DELETE);
 element.sendKeys(resolvedValue); // finally send the new input value

The actions are only used to move to that element. I've tried to combine all the steps with the actions but ended up with issues sending the keys.

christophd commented 2 years ago

So SetInputAction should be able to work on a preselected element, right? How did you find/identify that element then when it is not accessible via findBy selectors?