So, in my script I am scraping some data from a site via relevant XPATHs. I do this several times, for different versions of the site that I encounter. For each iteration I push my data (3 strings, populated via XPATH get calls), into their own separate list.
Out of the 3 total lists I have: the first two populated perfectly fine with all 3 string variables I expected them to contain. The third one would only display one of the strings I pushed into it when I viewed the results in my ‘execution-result.log’ file.
Example of what the file output looked like in excel:
lst_one LIST “[string one, string two, string 3]”
lst_two LIST “[string one, string two, string 3]”
lst_three LIST [string 3]
Notice that lst_three does not show a list surrounded by quotations, this is something I noticed when consulting the output. Also of note, the the two string variables that I was attempting to push into the list, both showed in the execution log that they contained the string data that I expected them to contain, they just did not push, for whatever reason. After switching things up and playing with it a few times, I noticed that normal behavior for the execution-result.log output is to show lists as having quotations around them, and since my lst_three did not, I figured that list variable could have somehow became corrupted.
So, I created a new list called lst_temp and pushed all three of the same variables that should’ve gone into lst_three, into this new list. After checking the log, they all were properly pushed. My conclusion is that my lst_three variable somehow became corrupted and was I was unable to properly push data into it for this reason.
The method I used to push the string data into my lists was the ‘Expression’ action, with the “Push (append)” operation.
*Note, I also opened up my .rpae file in a text editor, just to check that my variables all looked consistent in their instantiation/definition in code form, and my lst_three variable looked like it was properly defined in comparison to my lst_one and lst_two variables, so I was unable to visually determine there was anything wrong with it, outside of the fact that it would not accept my pushing of two strings into it, when consulting my output log.