03 Dec 2018 02:00 PM - last edited on 30 Sep 2022 01:05 PM by MaciejNeumann
Hi guys,
We are trying to get the value out of the follows element
<input
name="ctl00$hdnUserNT"
type="hidden"
id="hdnUserNT"
value="ODCOHEN"
/>
When checking with querySelector we see the value
Within dynatrace we are trying to tag the user with #hdnUserNT@value or any other way the session but with no success.
Can it because of it start with input? or something else that we are missing or doing wrong?
Thanks in advance
Yos
Solved! Go to Solution.
03 Dec 2018 02:29 PM - last edited on 16 Oct 2023 03:53 PM by random_user
Hi,
In the link below you have an explanation on how to correctly make a css selector:
(Answer by Gautier B.) https://community.dynatrace.com/questions/198298/cs...
Did you do it this way?
Radek
03 Dec 2018 02:44 PM
Hi Radek,
Yes we used the copy css selector
When using Chrome it seem to work OK but all the users are using IE
Yos
03 Dec 2018 06:42 PM
@Yos N. the reason is that you are trying to get value from input. This rules are generaly (according to my knowledge) usefull for element like span, div etc, not for input. Because Dynatrace is trying to get not value of element, but content of element. For input it's not possible. If code is managed by you, you can create extra element, or better, global JS variable which will provide value for you.
Regards,
Sebastian
04 Dec 2018 07:29 AM
Hi Sebastian,
Thanks for the information
Will try to change the type of the filed and / or use a global JS varibale
Yos
04 Dec 2018 08:00 AM
You can also store this value in cookie if it's easier for you 🙂 Generally most of the time we are asking clients for adding JS variable or cookie, because HTML and CSS can change over time and such rules may stop working (css selectors).
04 Dec 2018 07:35 AM
Yup, agree with Sebastian (Also based on experiences and failures I've ran into 🙂 although I couldn't find any articles or knowledges or book that 100% confirm this).
But like Sebastian said, you would have a higher chances of success if try to extract it from value instead of users' input. So maybe, try to extract it from web pages after login, instead of InputTextBox that wait for users input.