FindElements works locally but not on my server
See original GitHub issueThe problem
Hi guys,
I have installed Appium and Android Studio on my PC and server.
On the server side, I launch the emulator without graphical interface
<my-path-to-emulator>/emulator -avd Pixel_4_API_30_Google_API -no-window -no-skin -no-audio -no-snapshot-load
Once my emulator is launched, I type node index.js
to launch my script
Locally, findElements gives me a list of elements
2022-06-02T14:11:40.818Z INFO webdriver: COMMAND findElementsFromElement("00000000-0000-0008-ffff-ffff000000e2", "id", "cl_category_row")
2022-06-02T14:11:40.820Z INFO webdriver: [POST] http://127.0.0.1:4723/wd/hub/session/5c981908-cbd4-4e8b-9b11-98ab82b252df/element/00000000-0000-0008-ffff-ffff000000e2/elements
2022-06-02T14:11:40.820Z INFO webdriver: DATA { using: 'id', value: 'cl_category_row' }
2022-06-02T14:11:40.857Z INFO webdriver: RESULT [
{
'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0008-ffff-ffff000000e3',
ELEMENT: '00000000-0000-0008-ffff-ffff000000e3'
},
{
'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0008-ffff-ffff000000e7',
ELEMENT: '00000000-0000-0008-ffff-ffff000000e7'
},
{
'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0008-ffff-ffff000000eb',
ELEMENT: '00000000-0000-0008-ffff-ffff000000eb'
},
{
'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0008-ffff-ffff000000ef',
ELEMENT: '00000000-0000-0008-ffff-ffff000000ef'
},
{
'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0008-ffff-ffff000000f3',
ELEMENT: '00000000-0000-0008-ffff-ffff000000f3'
},
{
'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0008-ffff-ffff000000f7',
ELEMENT: '00000000-0000-0008-ffff-ffff000000f7'
},
{
'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0008-ffff-ffff000000fb',
ELEMENT: '00000000-0000-0008-ffff-ffff000000fb'
},
{
'element-6066-11e4-a52e-4f735466cecf': '00000000-0000-0008-ffff-ffff000000ff',
ELEMENT: '00000000-0000-0008-ffff-ffff000000ff'
}
]
However, on my server, it gives me an empty list:
2022-06-02T14:43:03.002Z INFO webdriver: COMMAND findElementsFromElement("00000000-0000-0008-ffff-ffff0000003c", "id", "cl_category_row")
2022-06-02T14:43:03.003Z INFO webdriver: [POST] http://127.0.0.1:4723/wd/hub/session/1462332c-a204-4436-94d1-3a267c38025c/element/00000000-0000-0008-ffff-ffff0000003c/elements
**2022-06-02T14:43:03.003Z INFO webdriver: DATA { using: 'id', value: 'cl_category_row' }
2022-06-02T14:43:03.034Z INFO webdriver: RESULT []
I don’t undestand why it gives me nothing on my server
Environment
- Appium version (or git revision) that exhibits the issue: 1.22.3
- Desktop OS/version used to run Appium: Linux/Debian Server
- Node.js version (unless using Appium.app|exe): Server: v16.13.2 and PC: v12.22.9
- Package manager name and version (we only officially support NPM): NPM (Server: 8.1.2 and PC: 8.5.1)
- Mobile platform/version under test: On PC and server: Pixel 4 API 30 Android 11.0
- Real device or emulator/simulator: Emulator
- webdriverio: 7.19.7
Code
To find Elements:
var recyclerView = await client.$('id=rv_categories');
await recyclerView.waitForExist({
timeout: 5000,
timeoutMsg: 'Timeout after 5s'
});
var categories = await recyclerView.$$('id=cl_category_row'); // Locally, gives me a list of elements but on server nothing
Link to Appium logs
pc_appium_logs.txt server_appium_logs.txt
Please help !
Issue Analytics
- State:
- Created a year ago
- Comments:9
Top Results From Across the Web
python - Selenium can find element when run locally but can't ...
Basically, Selenium is finding the element fine when I run the code locally, but when the code is run on a Heroku server,...
Read more >Element not found in a runtime - SQA Stack Exchange
One more thing you can try use findElements instead of findElement, findElements will return an empty list if no matching element is found...
Read more >findElement vs findElements in Selenium - BrowserStack
The findElements command returns an empty list if no elements are found using the given locator strategy and locator value.
Read more >[Code example]-Why Selenium Server didn't find locator
Why is Selenium unable to find elements on some sites? Why is selenium find element not working? Why can't selenium find XPath even...
Read more >How to solve Element is not clickable at point in Selenium
It mostly happens in Chrome so if you are mostly working with Firefox or IE then you will not be getting this exception....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We are also having problems testing our applications, in this case the id exists in the element but when trying to locate it it doesn’t work, even locally, looking at the logs, a 404 is returned when using the Inspector’s Get Timing. Does it have anything to do with this issue?
Log:
Get Timing without ms to id:
Testing with a new app only with routes, button and testID:
Closed as resolved