To set attributes, you can execute some Javascript:
document.getElementById("yourid").setAttribute("yourattribute", "yourvalue");
You can use it like this in RF with the Selenium2library:
Execute Javascript | document.getElementById("yourid").setAttribute("yourattribute","yourvalue");
Some people even managed to inject javascript to make the element scroll (it never worked for me, but I have always tried in an iframe...)
Execute Javascript | window.scrollBY(x,y);
Another thing you can do is focusing on the slider, then simulate as many keypresses of the down arrow as you need, but this might not be accurate or might require a little bit of tweaking
I moved to logic to python:
def scroll_element(self, container_locator):
start_time = time.time()
content = Selenium2Library.get_webelement(container_locator)
while time.time() < start_time + timeout:
content.send_keys(Keys.ARROW_DOWN)
if content.get_attribute("yourattribute") == '20%':
return
#this is to make sure your kw is failing in case the value is not set to 20%, helpful for debugging. If removed, your test might fail later on, making debugging harder
raise Exception('Value was not set to blablah')
On Saturday, October 29, 2016 at 9:57:38 PM UTC+1, Shailesh Kumar wrote: