Quality is delighting customers
Query in POM in Appium, please check the below code and correct me,thing going wrong
App Details:
public class AppDetails {
public AndroidDriver<AndroidElement> Capabilities() throws MalformedURLException
{
File file = new File("src");
File filepath = new File(file,"mytest.apk");
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.DEVICE_NAME, "Adndroid Device");
dc.setCapability(MobileCapabilityType.APP, filepath.getAbsolutePath());
AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"),dc);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
return driver;
}
}
AppElements:
public class AppElements
{
@AndroidFindBy(id = "com.myapp:id/editText")
public WebElement json;
public AppElements(AndroidDriver<AndroidElement> driver)
{
PageFactory.initElements(new AppiumFieldDecorator(driver), this); > showing error at this line
}
}
Test Case:
public class JsonTestCase
{
AppElements appElements;
public static AndroidDriver<AndroidElement> driver;
@BeforeTest
public void loadApp() throws MalformedURLException
{
AppDetails appDetails = new AppDetails();
appDetails.Capabilities();
System.out.println("We are on the App page"+"\n");
}
@Test
public void enterAppData() throws InterruptedException
{
appElements = new AppElements(driver);
appElements.json.click();
appElements.json.clear();
appElements.json.sendKeys("https://s3.ap-south-1.amazonaws.com/Sandhya/myfile.json");
}
}
Result:
Invoking the app properly, but not able to execute enterAppData() in the test case.
Please help me.
Error I am getting is
FAILED: enterAppData
java.lang.NoClassDefFoundError: org/objectweb/asm/Type
Tags:
© 2021 Created by Quality Testing.
Powered by