问题
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