[
https://issues.jboss.org/browse/RF-13063?page=com.atlassian.jira.plugin.s...
]
Pavol Pitonak reassigned RF-13063:
----------------------------------
Assignee: Jiří Štefek (was: Pavol Pitonak)
RichFacesInputNumberSlider setValueByDragging
---------------------------------------------
Key: RF-13063
URL:
https://issues.jboss.org/browse/RF-13063
Project: RichFaces
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: qe
Affects Versions: 4.3.2
Reporter: Bernard Labno
Assignee: Jiří Štefek
Priority: Minor
In richfaces-qa/page-fragments there is RichFacesInputNumberSlider fragment. It would be
great to be able to test setting value as percentage of width implemented as dragging the
handle.
One can do it like that:
{code}
((JavascriptExecutor)
GrapheneContext.getProxy()).executeScript("arguments[0].scrollIntoView(true);",
weightSlider.getNumberSlider().getRoot());
waitGui();
final int width = weightSlider.getNumberSlider().getWidth();
final int where = (int) (width * percentage);
final WebElement handle = weightSlider.getNumberSlider().getHandleElement();
final Action action = new
Actions(GrapheneContext.getProxy()).clickAndHold(handle)
.moveToElement(weightSlider.getNumberSlider().getRoot(), where, 0)
.release(handle)
.build();
{code}
It is very important to bring component into view before dragging.
If you do not do that and component is very far to the right (you need to scroll to the
right to see it) then calculations are wrong.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira