Why Appium Studio failing to identify some objects

I am feeling strange in some cases Appium Studio failed to identify some objects when using with XPaths. I have a valid XPath, but not sure why it returns NoSuchElementException.

The same code works fine in Appium.

Please find my script below:
ChromeOptions options=new ChromeOptions();
options.addArguments(“disable-infobars”);

			caps=new DesiredCapabilities();
			caps.setCapability("deviceName", strDeviceName);
			caps.setCapability("browserName", "Chrome");
			caps.setCapability("platformname","Android");
			caps.setCapability("appPackage","com.android.chrome");
			caps.setCapability("appActivity","com.google.android.apps.chrome.Main");
			caps.setCapability(ChromeOptions.CAPABILITY, options);
			try {
				driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),caps);
			} catch (MalformedURLException e) 
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
driver.get(strAppURL);
driver.findElementByXPath("//input[@name='userName']").sendKeys(strUsername);
driver.findElementByXPath("//input[@name='password']").sendKeys(strPassword);
driver.findElementByXPath("//input[@name='login']").click();
driver.findElementByXPath("//input[@name='tripType' and @value='oneway']").click();
driver.findElementByXPath("//input[@name='findFlights']").click();
driver.findElementByXPath("//input[@name='reserveFlights']").click();
driver.findElementByXPath("//input[@name='buyFlights']").click();
driver.findElementByXPath("//img[@src='/images/forms/Logout.gif']").click(); //Here some how Appium Studio unable to identify object, whereas it is working fine in Appium

Following is Console output:
[TestNG] Running:
C:\Users\E002841\AppData\Local\Temp\testng-eclipse-1864166457\testng-customsuite.xml

[Fri May 12 12:22:53 IST 2017] [driver] Starting test: 'Parabank Sample Test'
[Fri May 12 12:22:53 IST 2017] [driver] {dontGoHomeOnQuit=false, noReset=false, dontStopAppOnReset=false, instrumentApp=false, reservationDuration=240, reportFormat=xml, fullReset=false, waitForDeviceTimeout=120000, useRemoteGrid=false, reportDirectory=D:\Programming\Appium\Results, browserName=Chromium, [enableclientlog, enableclientlogger]=false, autoWebview=false, udid=09478d300f4133f6, platformName=Android, testName=Parabank Sample Test}
[Fri May 12 12:22:53 IST 2017] [driver] context: WEBVIEW_1
[Fri May 12 12:22:53 IST 2017] [driver] application under test: 
[Fri May 12 12:22:53 IST 2017] [driver] app path: null
[Fri May 12 12:22:53 IST 2017] [driver] full reset: false
[Fri May 12 12:22:53 IST 2017] [driver] instrument: false
[Fri May 12 12:22:53 IST 2017] [driver] no reset: false
[Fri May 12 12:22:53 IST 2017] [driver] package name: null
[Fri May 12 12:22:53 IST 2017] [driver] activity name: null
[Fri May 12 12:22:53 IST 2017] [driver] stop on reset: true
[Fri May 12 12:22:53 IST 2017] [driver] browser: true
[Fri May 12 12:22:53 IST 2017] [driver] connecting localhost:8889
[Fri May 12 12:22:53 IST 2017] [driver] Call of getSessionID returned: 58fc
[Fri May 12 12:22:53 IST 2017] [driver] setting reporter directory: D:\Programming\Appium\Results
[Fri May 12 12:22:53 IST 2017] [driver] setting reporter format: xml
[Fri May 12 12:22:53 IST 2017] [driver] setting test name: Parabank Sample Test
[Fri May 12 12:22:54 IST 2017] [driver] wait for device '@serialnumber='09478d300f4133f6'' timeout-ms='120000'
[Fri May 12 12:23:01 IST 2017] [driver] Device 'adb:Nexus 5' ready
[Fri May 12 12:23:03 IST 2017] [driver] Call of launchApp returned: web
[Fri May 12 12:23:03 IST 2017] [58fc] [driver] [start] manage()
[Fri May 12 12:23:03 IST 2017] [58fc] [driver] [end] manage
[Fri May 12 12:23:03 IST 2017] [58fc] [driver] [start] get("http://newtours.demoaut.com/")
[Fri May 12 12:23:12 IST 2017] [58fc] [driver] [end] get
Navigate to application URL 'http://newtours.demoaut.com/'
[Fri May 12 12:23:17 IST 2017] [58fc] [driver] [start] findElementByXPath("//input[@name='userName']")
[Fri May 12 12:23:20 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:23:20 IST 2017] [58fc] [element] [start] sendKeys("udayanem")
[Fri May 12 12:23:24 IST 2017] [58fc] [element] [end] sendKeys
Enter username as 'udayanem'
[Fri May 12 12:23:24 IST 2017] [58fc] [driver] [start] findElementByXPath("//input[@name='password']")
[Fri May 12 12:23:25 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:23:25 IST 2017] [58fc] [element] [start] sendKeys("V@ud@ynvu80")
[Fri May 12 12:23:28 IST 2017] [58fc] [element] [end] sendKeys
Enter password as 'V@ud@ynvu80'
[Fri May 12 12:23:28 IST 2017] [58fc] [driver] [start] findElementByXPath("//input[@name='login']")
[Fri May 12 12:23:30 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:23:30 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:23:31 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:23:31 IST 2017] [58fc] [element] [start] click()
[Fri May 12 12:23:32 IST 2017] [58fc] [element] [end] click
Clicked on Sign In button
[Fri May 12 12:23:32 IST 2017] [58fc] [driver] [start] findElementByXPath("//input[@name='tripType' and @value='oneway']")
[Fri May 12 12:23:36 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:23:36 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:23:37 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:23:37 IST 2017] [58fc] [element] [start] click()
[Fri May 12 12:23:37 IST 2017] [58fc] [element] [end] click
Selected trip type as 'One Way'
[Fri May 12 12:23:37 IST 2017] [58fc] [driver] [start] findElementByXPath("//select[@name='passCount']")
[Fri May 12 12:23:39 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:23:39 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:23:40 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:23:40 IST 2017] [58fc] [element] [start] getAttribute("multiple")
[Fri May 12 12:23:41 IST 2017] [58fc] [element] [end] getAttribute
[Fri May 12 12:23:41 IST 2017] [58fc] [element] [start] findElements(By.xpath: .//option[normalize-space(.) = "2"])
[Fri May 12 12:23:41 IST 2017] [58fc] [element] [start] findElementsByXPath(".//option[normalize-space(.) = "2"]")
[Fri May 12 12:23:43 IST 2017] [58fc] [element] [end] findElementsByXPath
[Fri May 12 12:23:43 IST 2017] [58fc] [element] [end] findElements
[Fri May 12 12:23:43 IST 2017] [58fc] [element] [start] isSelected()
[Fri May 12 12:23:46 IST 2017] [58fc] [element] [end] isSelected
[Fri May 12 12:23:46 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:23:47 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:23:47 IST 2017] [58fc] [element] [start] select option()
[Fri May 12 12:23:47 IST 2017] [58fc] [element] [start] getAttribute("value")
[Fri May 12 12:23:48 IST 2017] [58fc] [element] [end] getAttribute
[Fri May 12 12:23:49 IST 2017] [58fc] [element] [end] select option
Selected number of Passengers as '2'
[Fri May 12 12:23:49 IST 2017] [58fc] [driver] [start] findElementByXPath("//select[@name='fromPort']")
[Fri May 12 12:23:51 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:23:51 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:23:52 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:23:52 IST 2017] [58fc] [element] [start] getAttribute("multiple")
[Fri May 12 12:23:53 IST 2017] [58fc] [element] [end] getAttribute
[Fri May 12 12:23:53 IST 2017] [58fc] [element] [start] findElements(By.xpath: .//option[normalize-space(.) = "Frankfurt"])
[Fri May 12 12:23:53 IST 2017] [58fc] [element] [start] findElementsByXPath(".//option[normalize-space(.) = "Frankfurt"]")
[Fri May 12 12:23:55 IST 2017] [58fc] [element] [end] findElementsByXPath
[Fri May 12 12:23:55 IST 2017] [58fc] [element] [end] findElements
[Fri May 12 12:23:55 IST 2017] [58fc] [element] [start] isSelected()
[Fri May 12 12:23:59 IST 2017] [58fc] [element] [end] isSelected
[Fri May 12 12:23:59 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:23:59 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:23:59 IST 2017] [58fc] [element] [start] select option()
[Fri May 12 12:23:59 IST 2017] [58fc] [element] [start] getAttribute("value")
[Fri May 12 12:24:00 IST 2017] [58fc] [element] [end] getAttribute
[Fri May 12 12:24:02 IST 2017] [58fc] [element] [end] select option
Selected Departing From station as 'Frankfurt'
[Fri May 12 12:24:02 IST 2017] [58fc] [driver] [start] findElementByXPath("//select[@name='toPort']")
[Fri May 12 12:24:04 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:24:04 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:24:05 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:24:05 IST 2017] [58fc] [element] [start] getAttribute("multiple")
[Fri May 12 12:24:05 IST 2017] [58fc] [element] [end] getAttribute
[Fri May 12 12:24:05 IST 2017] [58fc] [element] [start] findElements(By.xpath: .//option[normalize-space(.) = "New York"])
[Fri May 12 12:24:05 IST 2017] [58fc] [element] [start] findElementsByXPath(".//option[normalize-space(.) = "New York"]")
[Fri May 12 12:24:07 IST 2017] [58fc] [element] [end] findElementsByXPath
[Fri May 12 12:24:07 IST 2017] [58fc] [element] [end] findElements
[Fri May 12 12:24:07 IST 2017] [58fc] [element] [start] isSelected()
[Fri May 12 12:24:10 IST 2017] [58fc] [element] [end] isSelected
[Fri May 12 12:24:10 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:24:11 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:24:11 IST 2017] [58fc] [element] [start] select option()
[Fri May 12 12:24:11 IST 2017] [58fc] [element] [start] getAttribute("value")
[Fri May 12 12:24:12 IST 2017] [58fc] [element] [end] getAttribute
[Fri May 12 12:24:13 IST 2017] [58fc] [element] [end] select option
Selected Arriving station as 'New York'
[Fri May 12 12:24:13 IST 2017] [58fc] [driver] [start] findElementByXPath("//input[@name='servClass' and @value='Business']")
[Fri May 12 12:24:15 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:24:15 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:24:16 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:24:16 IST 2017] [58fc] [element] [start] click()
[Fri May 12 12:24:17 IST 2017] [58fc] [element] [end] click
Selected Flight Preferences as 'Business Class'
[Fri May 12 12:24:17 IST 2017] [58fc] [driver] [start] findElementByXPath("//input[@name='findFlights']")
[Fri May 12 12:24:19 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:24:19 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:24:20 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:24:20 IST 2017] [58fc] [element] [start] click()
[Fri May 12 12:24:20 IST 2017] [58fc] [element] [end] click
Click on Continue
[Fri May 12 12:24:20 IST 2017] [58fc] [driver] [start] findElementByXPath("//input[@name='reserveFlights']")
[Fri May 12 12:24:24 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:24:24 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:24:25 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:24:25 IST 2017] [58fc] [element] [start] click()
[Fri May 12 12:24:26 IST 2017] [58fc] [element] [end] click
Click on Continue to select flight
[Fri May 12 12:24:26 IST 2017] [58fc] [driver] [start] findElementByXPath("//input[@name='buyFlights']")
[Fri May 12 12:24:32 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:24:32 IST 2017] [58fc] [element] [start] getTagName()
[Fri May 12 12:24:33 IST 2017] [58fc] [element] [end] getTagName
[Fri May 12 12:24:33 IST 2017] [58fc] [element] [start] click()
[Fri May 12 12:24:35 IST 2017] [58fc] [element] [end] click
Continuing default customer details
[Fri May 12 12:24:35 IST 2017] [58fc] [driver] [start] findElementByXPath("//b[contains(.,'itinerary has been booked')]")
[Fri May 12 12:24:38 IST 2017] [58fc] [driver] [end] findElementByXPath
[Fri May 12 12:24:38 IST 2017] [58fc] [element] [start] isDisplayed()
[Fri May 12 12:24:39 IST 2017] [58fc] [element] [end] isDisplayed
Ticket booke successfully
[Fri May 12 12:24:39 IST 2017] [58fc] [driver] [start] findElementByXPath("//img[@src='/images/forms/Logout.gif']")
[Fri May 12 12:25:40 IST 2017] [58fc] [driver] [end] findElementByXPath
FAILED: bookFlight
org.openqa.selenium.NoSuchElementException: org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'HW1612', ip: '10.250.57.11', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_101'
Driver info: driver.version: SeeTestAndroidDriver
	at com.experitest.appium.STExceptions.throwNoSuchElementException(STExceptions.java:8)
	at com.experitest.appium.SeeTestAndroidElement.findElementBy(SeeTestAndroidElement.java:36)
	at com.experitest.appium.SeeTestAndroidDriver.findElementBy(SeeTestAndroidDriver.java:137)
	at com.experitest.appium.SeeTestAndroidDriver.findElementByXPath(SeeTestAndroidDriver.java:645)
	at SeeTestVsAppium.bookFlight(SeeTestVsAppium.java:166)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	at org.testng.TestRunner.privateRun(TestRunner.java:756)
	at org.testng.TestRunner.run(TestRunner.java:610)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
	at org.testng.TestNG.runSuites(TestNG.java:1133)
	at org.testng.TestNG.run(TestNG.java:1104)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)


===============================================
    Default test
    Tests run: 1, Failures: 1, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.XMLReporter@c03cf28: 20 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@8317c52: 15 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 28 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@2e55dd0c: 165 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@378542de: 27 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@11bd0f3b: 181 ms

Hi

This is probably due to the src property that you have under the img tag
the solution is to ask Appium Studio to collect this property as-well when it’s producing a dump of the screen

this can be achieved by editing the app.properties files which is found under %appdata%\app.properties

and appending the line

additional.web.identifiers=src

you can add multiple identifiers by using “,” as a delimiter

e.g - additional.web.identifiers=src,ng-if

For more info : https://docs.experitest.com/display/AS/Additional+Web+Properties

Our plan is to support all identifiers by default (same as Selenium does) by the upcoming releases, so this method should be deprecated by the end of June 2017

Tom,

Thanks for your time and it worked perfect.

Thanks,
Uday

Happy to hear :blush: