Set value of ion-range slider to specific value

本小妞迷上赌 提交于 2020-06-01 05:07:50

问题


I am writing scripts in robot-framework with appium-library. I have range slider on my page and I need to slide it to some specific value. I tried swipe and it was working but I want to swipe slider to specific value. for e.g. lets say My current range value is 10 and I want to slide it upto 11. How can I calculate my end_x and end_y in this case.

I also tried Execute Script where I was setting value to DOM element directly. But when I am running script its giving me error "WebDriverException: Message: Method is not implemented". My ID is right and I crossed check it in chrome console where I was able to set value directly to DOM.

I have written swipe logic to swipe left or right but it is not what I want. If someone want to see or if may can help to understand my problem, I am posting it here :

${element_size}=                 Get Element Size        ${param_range}
${element_location}=             Get Element Location    ${param_range}


${start_x}=       Evaluate               ${element_location['x']} * (1)
${start_y}=       Evaluate               ${element_location['y']} * (1)
${end_x}=         Evaluate               ${element_location['x']} - (0.1)
${end_y}=         Evaluate               ${element_location['y']} * (1)

Swipe    ${start_x}    ${start_y}    ${end_x}    ${end_y}    1500
Sleep    1

来源:https://stackoverflow.com/questions/62052275/set-value-of-ion-range-slider-to-specific-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!