Need help in identifying the right keyword in browser robot framework for slider

48 views
Skip to first unread message

preeya krish

unread,
Nov 14, 2023, 1:21:02 AM11/14/23
to robotframework-users
Attached the element image and css.

Have tried these in my script.
Scroll By    id=select-weightage      horizontal=${model_weightage}
Scroll To    id=select-weightage      horizontal=${model_weightage}

Keyword is getting executed, but values are not getting updated. Verified by taking screenshot.

Hence need some inputs on which keyword to use.
tempsnip.png
slider.PNG

Nkina Ramonyai

unread,
Nov 14, 2023, 7:56:10 AM11/14/23
to preeya...@gmail.com, robotframework-users
Hi Preeya

I found a way to automate scroll bar:
Here is my code block
Choose an annual increase percentage ${locator} AND ${ycord} AND ${xcord}
    ${x}=        Get Horizontal Position  ${locator}
    ${y}=        Get Vertical Position    ${locator}
    ${yaxis}=   Evaluate    ${y} - ${ycord}
    ${xaxis}=   Evaluate    ${x} - ${xcord}
    Execute Javascript  window.scrollTo(${xaxis}, ${yaxis})
Drag And Drop By Offset  ${locator}  ${yaxis}  ${xaxis}:

FYI: You are going to need to do trial and error for the ${ycord} AND ${xcord} values, as there is no standard/straight line way to get the values.
Here is the element I am trying to drag, hope this helps.
image.png

Thanks,

Kind regards
Nkina
 
 




--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/36e910bf-61e3-4b58-a70c-960ce251e8b2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages