简体   繁体   中英

Telerik Test Studio - Interacting With Webpage Sliders Outside of Kendo UI

I've been going through Telerik Test Studio's online resources and tutorials, and none of these basic examples seem to cover what I'm having issues with – sliders.

I'm looking to do some tests on a webpage that has slide bars. The way that they are implemented is a bit strange, and I so I wanted to ask what the common practice was for working with sliders in Telerik Test Studio. I've experimented with drag and drop, which doesn't seem to work consistently (since the action's start and end location are based on the monitor). There seemed to be potential in regards to the MouseDown + DragTo + Mouse Up actions, but I couldn't seem to get them to work on the interface I was testing either. In general, I would love to have some advice on how to interact with sliders outside of the nicely laid out Kendo UI elements.

Thank you in advance for any feedback.

In my team we usually use the Kendo JavaScript API and wrap it in controls for example:

public class KendoColorPicker
{
    private readonly string colorPickerSetColorExpression =
        "$('#{0}').data('colorpicker').value('#{1}');";
    private readonly string idLocator;
    public KendoColorPicker(string idLocator)
    {
        this.idLocator = idLocator;
    }
    public void SetColor(string hexValue)
    {
        string scriptToBeExecuted = string.Format(colorPickerSetColorExpression, this.idLocator, hexValue);
        Manager.Current.ActiveBrowser.Actions.InvokeScript(scriptToBeExecuted);
    }
}

I wrote an article about it- Advanced Web UI Components Automation with Telerik Testing Framework . I think you can use a similar approach.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM