question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

org.openqa.selenium.NoSuchElementException: Can't locate an element by this strategy: Locator map:

See original GitHub issue

The problem

1.7.2-beta2 + java client version 5.0.4

  1. I had an element which was working in earlier version of appium
@AndroidFindBy(xpath="//android.widget.Button[@content-desc='button-lets-begin']")
@iOSFindBy(xpath="//XCUIElementTypeButton[@name='button-lets-begin']")
private WebElement LetsBeginButton;
org.openqa.selenium.NoSuchElementException: Can't locate an element by this strategy: Locator map: 
- native content: "By.id: LetsBeginButton" 
- html content: "by id or name "LetsBeginButton""
	at io.appium.java_client.pagefactory.AppiumElementLocator.findElement(AppiumElementLocator.java:102)
	at io.appium.java_client.pagefactory.interceptors.InterceptorOfASingleElement.intercept(InterceptorOfASingleElement.java:61)
	at org.openqa.selenium.remote.RemoteWebElement$$EnhancerByCGLIB$$d27c0df4.click(<generated>)

Environment

  • Appium version (or git revision) that exhibits the issue: 1.7.2-beta2
  • Last Appium version that did not exhibit the issue (if applicable): 1.7.0
  • Desktop OS/version used to run Appium: Mac OS
  • Node.js version (unless using Appium.app|exe): v8.4.0
  • Mobile platform/version under test: iOS Simulator 11.2
  • Real device or emulator/simulator: simulator
  • Appium CLI or Appium.app|exe: CLI

Details

If necessary, describe the problem you have been experiencing in more detail.

Link to Appium logs

https://gist.github.com/vikramvi/53556a6fe2cef7e5363c8b75a50d5f8e

Code To Reproduce Issue [ Good To Have ]

NA

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
vikramvicommented, Dec 16, 2017

@TikhomirovSergey can you please look into this issue

  • It happens with serenity-core version v1.8.9 which has got latest appium java client.
  • getPageSource does show element but it can’t be clicked because of error
1reaction
ppzzsscommented, May 3, 2018

Below annotations work well in Appium 1.7.2

@iOSXCUITFindBy (xpath = “xxxx”) @AndroidFindBy (id = “bbbb”) public WebElement usernameTextField;

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "Can't locate an element by this strategy
How to fix "Can't locate an element by this strategy: Locator map:" · Your xpath is incorrect. You are missing a @ in...
Read more >
org.openqa.selenium.NoSuchElementException: Can't locate ...
org.openqa.selenium.NoSuchElementException: Can't locate an element by this strategy: Locator map: ... Element is visible but still Appium is not ...
Read more >
Unable to locate element throwing a org.openqa.selenium ...
Selenium is not able to find the element. Either check the selector that you have used, or if the element appears after some...
Read more >
Everything you need to know about NoSuchElementException ...
A NoSuchElementException occurs when the Selenium locator strategy defined is unable to find the desired HTML element in the web page.  ...
Read more >
Unable to find element selenium python
Org openqa selenium nosuchelementexception can t locate an element by this strategy : locator map. org.openqa.selenium.NoSuchElementException: Can't ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found