Likely you construct with the missing first and last missing brace will not work. Try comparing the association between User and UserRole against the UserRoleTokens the are available, like this XPath:
Directly after typing the
followed by: arrow up
This takes to the bottom of the list, where the userrole tokens are.
Try this to see if this user has either of these roles. The screenshot of Tim was not quite correct.
Other way would be to retrieve the user roles of current user and use the find action to check if it has that user role.
Unfortunately using attributes is not acceptable for xpath while using contains… so if variables are accepted there must be a way to make this work. i just need, not to print ' when variable is passed, instead it should only print single quote..
Attaching screenshot of what works and what does not, seeking help on this. Its inverted as the upload was stripping the image into half.
i would have loved to have a solution to this in xpath itself. unfortunately i think i might be hitting some limitation of xpath. in case i am wrong and if anyone finds a solution please update.
so since this didnt work, i moved over to oql query statement, and it works perfectly fine there.
few things to note, when i constructed the whole of oql query into a variable and use it , it didnt work either.
so i put in the static section of the query into the oql statement and used a variable for the dynamic section.
that worked perfectly fine. with xpath im still using variable for dynamic section ,but it does not work at all.
anyways my problem is resolved by oql.
here is the query example
'SELECT C.Cluster as Cluster
FROM Test.Cluster as C
WHERE C.Roles LIKE '''+'%'+$oqlpatrialquery +''
the variable has following construction.
Role1%' OR C.Roles LIKE '%Role2%' OR C.Roles LIKE ‘%Role3%’