iosswiftxcode-ui-testing

Xcode UITesting - how to move UISlider?


Is there a way to move UISlider under UITests target in Xcode? I really need to move it from code. Is it possible?


Solution

    1. Get your slider:

      let app = XCUIApplication()
      let timeSlider = app.sliders["timeSlider"]
      
    2. Adjust its value:

      timeSlider.adjustToNormalizedSliderPosition(0.9)