I have created an array of Report names, and am creating a “for each” loop to interact with each of the reports which are in an online application (step 1 being to double click to report to open). Using a log message I have confirmed that the array item is being read correctly in the first instance and this matches the name of the first report shown on screen. So I am trying to create a selector using each of the Report names as a dynamic variable:
" webctrl parentid=‘xyz’ aaname=‘“+strReportName.ToString()+”’ /" (in both quotes and triangle brackets, but brackets don’t show? Also xyz changed, but works elsewhere, don’t think that’s the issue)
strReportName is a string type variable already, but I tried with/without .ToString in case. However when I run the component it is unable to find the selector:
Message: Unable to cast object of type ‘Newtonsoft.Json.Linq.JValue’ to type ‘System.String’.
Exception Type: InvalidCastException
I have created this in expression editor as well, as per other suggestions I have seen which others say fixed their issues.
Any help would be greatly appreciated. Many thanks!
quick tip is to use the backslash “\” infront of the character that won’t show up in your post.
Like this: < and \>
also, you can use the code syntax like with ``` surrounding your text and you don’t need to use the backslash. Like this:
< \>
Can you verify the selector before it uses it in either a Message box or Write Line —paste entire selector. This will atleast tell you that the variable and selector is correct.
Thanks for your quick response, and apologies for this obvious question - how do I print out the selector? I tried however it says it can’t convert ‘System.Xml.Linq.XElement’ to ‘String’, and when I convert to string it just prints out the selector as is, without using the variable? This is same for both write line and log message.
As you can see, in the bottom right it says the selector isn’t valid, so perhaps it can’t find the selected element on the page, could that be the issue, or is it that the selector itself can’t be read properly?
I am too new to upload attachments, sorry, I tried. Maybe new accounts take a few days to verify properly as I have also completed orchestrator and foundation training and no badges are appearing, so perhaps my account is still limited.
The reports I’m trying to click are behind a “frame” within IE, so selectors have been tricky for this whole process, however as mentioned, worked for others (as an example \ <webctrl parentid='com.hyperion.bpmex.web.tree.GridView-*' aaname='Report_Books' /> worked fine for me to get to the reports).
I copied your text into notepad, updated the xyz, then copy and pasted into the selector input on the properties panel, before attempting again to run. Exactly the same error message though?
Hi. I just meant to copy the string from the Expression Editor and paste it into a Message Box or Write Line. This will show what the selector really looks like with your variable. If there is a weird character or something getting in there, then your selector will fail.
Also, yeah, any special characters like “&” will need to be replaced with a wildcard “*”.