Hi All,
I am trying to automate a button click to send a message to someone on linkedin website. Everytime, I visit the particular page for my friend's profile the message button appears to have a different path.
On the first run, I got the path below
.//div[#'ember5']/div[5]/div[3]/div/div[2]/div/div[2]/div/div//ul/li/div/div/div[3]//button[@innertext='Message']
On the second run, ranorex could not find the element and I noticed that the path had changed to the path below
.//div[#'ember7']/div[5]/div[3]/div/div[2]/div/div[2]/div/div//ul/li/div/div/div[3]//button[@innertext='Message']
As you can see, looks like that the first time I went to that page "ember5" was in the path however the second time I went to the same page "ember7" was in the path.
Attached is a screenshot using the spy tool.
Can someone recommend a way to fix this problem so I can always find that Message button on the linkedin website?
Thanks
Ricardo
Ranorex can't find element
-
- Posts: 15
- Joined: Fri Sep 06, 2019 2:21 pm
Ranorex can't find element
You do not have the required permissions to view the files attached to this post.
Re: Ranorex can't find element
Hi,
Could you please upload a Ranorex snapshot (NOT screenshot) of the problematic element?
Generally speaking, you will most probably have to update each recorded xpath to make it independent from dynamic ID. The xpath could look like this:
.//div[@id~'ember']/div//button[@innertext='Message']
If the xpath returns more than one element, you will have to make more specific, by adding some more element. I would strongly recommend to avoid all index numbers, which are highly volatile and prone to changers.
Could you please upload a Ranorex snapshot (NOT screenshot) of the problematic element?
Generally speaking, you will most probably have to update each recorded xpath to make it independent from dynamic ID. The xpath could look like this:
.//div[@id~'ember']/div//button[@innertext='Message']
If the xpath returns more than one element, you will have to make more specific, by adding some more element. I would strongly recommend to avoid all index numbers, which are highly volatile and prone to changers.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 15
- Joined: Fri Sep 06, 2019 2:21 pm
Re: Ranorex can't find element
Thanks I figured it out on my own