Appium Android SendKey not working - appium

I am trying to automate my android application test on testdroid server using Appium Java client. I am getting exception that unable to locate element while using element.sendKeys on AndroidElement.
AndroidElement element = wd.findElement(By.xpath("//android.widget.LinearLayout[1]"
+ "/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]"
+ "/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]"
+ "/android.widget.EditText[1]"));
element.click();
wd.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
element.sendKeys("Hello World");
In above code element.sendKeys throws exception
An element could not be located
Looks like it is "hinted text issue" of sendKey but not sure.
Please suggest me solution.

For android you should set capability "unicodeKeyboard" to "true". Also don't forget to reset
capabilities.setCapability("unicodeKeyboard", "true");
capabilities.setCapability("resetKeyboard", "true");
Refer http://appium.io/slate/en/v1.3.4/?ruby#android-only

Related

Appium automation in Windows

So I've been trying to get my desired capabilities for a while and it's not working with the error of "failed to create session.
An unknown server-side error occurred while processing the command. Original error: Could not find a driver for platformName 'android'.
Please check your desired capabilities", I've tried a few other settings but nothing is working help me
{
"platformName":"andriod",
"appium:platformVersion": "11.0",
"appium:deviceName":"Saint", "appium:automationName":"capability",
"appium:app": "path"
}
Not much help with what you have provided , but session is not getting created can have multiple scenarios.
Check your Appium server is running.
Define your driver correctly either appium/androiddriver/iOSdriver..
Your capabilities list are not full , so please try to paste full error since it will be helpful.
Just replace these capabilities from your code with these name/caps
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("udid", udid);
desiredCapabilities.setCapability("platformVersion", platformVersion);
desiredCapabilities.setCapability("platformName", "Android");
desiredCapabilities.setCapability("appActivity", "<Your App activity>");
desiredCapabilities.setCapability("automationName","UiAutomator2");
}}

Appium couldn't install the app to real device

I have updated appium recently, since then I can't get it to work.
Followings are the errors shows in the appium log"
Error was thrown during the installation process. TypeError
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
Error: Could not install app: 'The "path" argument must be of type
string. Received type undefined'
at IOSDeploy.install
(/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/ios-deploy.js:41:13)
When trying to open the inspector session, it only opens the simulator and the inspector window keeps on loading.
DesiredCapabilities:
DesiredCapabilities des = new DesiredCapabilities();
des.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone XS Max");
des.setCapability(CapabilityType.PLATFORM_NAME, "IOS");
des.setCapability("noReset", true);
des.setCapability("fullReset", false);
des.setCapability(MobileCapabilityType.UDID, "00008020-001D650021D8002E");
des.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
des.setCapability(MobileCapabilityType.PLATFORM_VERSION, "13.0");
des.setCapability(MobileCapabilityType.APP, "/Users/isururodrigo/Library/Developer/Xcode/DerivedData"
+ "/VisitSingapore-aheghxbadxxzuzardfddwixazzfm/Build/Products/Debug-Staging-iphoneos/VS-Staging.app");
try {
driver = new IOSDriver<IOSElement>(new URL("http://127.0.0.1:4723/wd/hub"), des);
} catch (MalformedURLException e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
driver.setLogLevel(Level.INFO);
Appium v1.15.0-1
Node v10.16.3
xcode v11.1
iOS v13.1.2
I managed to solve this issue by updating the v1.15.1, if anyone of you facing this issue update to the latest which is available in this link.
New pre-release is out for v1.15.1: https://github.com/appium/appium-desktop/releases/tag/v1.15.1

Instantiating Appium IOS/Android driver

I'm using appium-dotnet-driver v4.0.0.4 beta of the appium nuget package (but I have downgraded to the previous versions too and I'm getting the same issue)
So I've never used it before, therefore not entirely sure how it should work. Currently I'm doing this:
private static AppiumDriver<AppiumWebElement> mobileDriver;
AppiumOptions opt = new AppiumOptions();
opt.AddAdditionalCapability("autoWebview", true);
switch (platform.ToLower())
{
case "ios":
{
foreach (var cap in MobileSettingsFileConstants.iosCapabilities)
{
opt.AddAdditionalCapability(cap.Key, cap.Value);
}
mobileDriver = new IOSDriver<AppiumWebElement>(GridUri, opt);
break;
}
When ever it tries to add an additional capability to Appium Options I get an exception : Exception thrown: 'System.MissingMethodException' in appium-dotnet-driver.dll, Additional information: Method not found: 'Void OpenQA.Selenium.Remote.DesiredCapabilities.set_Item
I've had a look on the appium forum and they said this was an issue. Can someone share their experience with this please?
I found out I had to be at the latest version on Selenium on both test framework and test solution.
Simple answer to a mind boggling question.

Android driver issue

I am new to mobile automation with appium.i am getting error message "The constructor AndriodDriver (Capabilities) refers to the missing type Capabilities ".
driver=new AndriodDriver (new URL("127.0.0.1:4723"),
Capabilities);
Go through the below links. Those might be help full
http://toolsqa.com/mobile-automation/appium/download-and-install-nodejs/
http://www.software-testing-tutorials-automation.com/2015/09/appium-tutorials.html

Target Unreachable, identifier 'xxxBean' resolved to null when running JasperReports 6.0.1

I have an application that was working fine until I added code to run a JasperReport. The error is the well known
Target Unreachable, identifier 'studentBean' resolved to null
After adding the code needed to run a JasperReport, the particular page that uses that bean (StudenBean) started to show such an exception before it even shows. After a process of commenting/uncommenting lines of code, I could isolate de precise line that brings the problem. It's shown below:
private void gerarRelatorioPDF(List<Student> students, InputStream report, OutputStream pdf) {
JRDataSource jrds = new JRBeanCollectionDataSource(students);
try {
JasperRunManager.runReportToPdfStream(report, pdf, null, jrds); // <<-- Here!!!
} catch (Exception e) {
e.printStackTrace();
}
}
It's the line that generates a PDF stream from a JasperReport definition. This method is private because it's called by another public method. The public method is the action of a <p:commandButton/> in the page, so this button is not even being clicked, because the exception prevents the page to render.
If I comment that line of code, the page renders ok and I can click the button, but obviously no report will be generated.
Any ideas how to fix it?
After some study, I decided to modify my POM.xml (Maven script) to include JasperReports 6.0.0. Previously I had only installed JasperReports 6.0.1 plugin in Eclipse, created and configured the report.
When we add a new report to a project, Eclipse automatically adds the path to JasperReports libraries to the class path, so the project compiles fine, but it seems that some other dependencies are not added and, specially, not deployed to the application server (in my case JBoss AS 7.1).
After updating the POM.xml to include JasperReports, everything started to work as desired.

Resources