4

I'm new to C# but have good experience with Appium. For the screen in question, there is an edit field 'Please enter your appcode'. Appium desktop is identifying the element with 'id' easily. After identification, I am trying to click and have to enter a value for appcode. Surprisingly in java, this element is identified easily with 'Id'.enter image description here

I have tried with 'FindElementById','FindElementByAccessibilityId' and 'FindElementByXPath' but none of them is working. I also tried with Explicit wait.

  IWebElement Appcode = driver.FindElementByAccessibilityId("com.abc.dbanking:id/appcode_tie");

or

     IWebElement Appcode = driver.FindElementById("com.abc.dbanking:id/appcode_tie");

or

IWebElement Appcode = driver.FindElementByXPath("//android.widget.EditText(@resource-id = 'com.abc.dbanking:id/appcode_tie'));

or

  WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(45));
        IWebElement Appcode = wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(By.Id("com.abc.dbanking:id/appcode_tie")));

But every time I am getting 'NoSuchElementException' and driver is not able to locate this element on the page.

Deepak
  • 110
  • 2
  • 16

1 Answers1

2

try IWebElement element = driver.FindElementById("appcode_tie"); or IWebElement element = driver.FindElementByXPath("//*[contains(@resource-id, 'appcode_tie')]");

rusu dan
  • 21
  • 6
  • thanks for your best efforts. But it is still not working. Please let me know if you still come across any other solution. – Deepak Jul 10 '19 at 10:12