Hi All,

I am currently working on writing UI test-cases using selenium for
Dashboard Server(DS)/User Engagement Server.I have a test Case which needs
to do a action that drag one element to a place and drop it in that
place(drag and drop).So I have tried the below approach to do this task.

public void testAddGadgetToDashboard() throws Exception {
    webElement = getDriver().findElement(By.id(dashboardTitle));
    webElement.findElement(By.cssSelector("a[href=\"dashboards/" +
dashboardTitle + "?editor=true\"]")).click();
    WebElement draggable = getDriver().findElement(By.id("g1"));
    WebElement to = getDriver().findElement(By.id("a"));
    Actions builder = new Actions(getDriver());
    Action dragAndDrop = builder.clickAndHold(draggable)
            .moveToElement(to)
            .release(to)
            .build();
    dragAndDrop.perform();

}

But I am getting an exception when running the test-case,

FAILED: testAddGadgetToDashboard
        Adding gadgets to existing dashboard from dashboard server
java.lang.ClassCastException: org.wso2.ues.ui.integration.util.UESWebDriver
cannot be cast to org.openqa.selenium.interactions.HasInputDevices
at org.openqa.selenium.interactions.Actions.<init>(Actions.java:41)
at
org.wso2.ues.ui.integration.test.dashboard.AddgadgetToDashboardtest.testAddGadgetToDashboard(AddgadgetToDashboardtest.java:86)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:177)
at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at
org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

Can anyone please advice me on how this has gone wrong and Is selenium
version or Firefox version are depends on this error thrown?

Note: I am using Firefox version 27 and selenium version is automation
selenium version.
-- 

*Thank You.*

*Rajeenthini Satkunam*

*Associate Software Engineer | WSO2*


*E:rajeenth...@wso2.com <rajeenth...@wso2.com>*

*M :+94770832823   *
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to