Swipe Methods are not working which are present in the appium studio library?

Hi All,

Swipe Methods are not working which are present in the appium studio library with C#,
I need help.

These are the below ways i have tried:None of them are working

public bool ElementSwipe()
{
bool isSuccess = false;
try
{
AppiumWebElement element = Driver.FindElementByXPath("//*[@text=‘CHAPTER ADMINISTRATOR’]");
((IJavaScriptExecutor)Driver).ExecuteScript(“arguments[0].scrollIntoView(true);”, element);

            // 
            //  if (client.SwipeWhileNotFound("Down", 0, 2000, "NATIVE", "xpath=//*[@text='Best Picture Winners']", 0, 1000, 5, true))
            //{
            // If statement
            // }

            //  Driver.swipeWhileNotFound("down", 150, 200, "//*[@text='CHAPTER ADMINISTRATOR']", 1000, 20, true);
            // string str1 = (string)Driver.ExecuteScript("client:client.swipeWhileNotFound(\"down\", 150, 200, \"//*[@text='CHAPTER ADMINISTRATOR']\", 1000, 20, true)");
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        return isSuccess;
    }

Hi Hari

I think that the version you are workign with has a bug with the exporting swipeWhileNotFound command in C#

please try :

string str1 = (string)Driver.ExecuteScript("client:client.swipeWhileNotFound(\"down\", 150, 200,'NATIVE', \"//*[@text='CHAPTER ADMINISTRATOR']\", 1000, 20, true)");

Note that I’ve added the context string (NATIVE) - which indicates which context is the element your are swiping to resides

this issue is fixed in the upcoming version

Sorry for the trouble

Tom