TypeError: Expected argument 1 to be a list or list-like, got string instead. robot frame work - robotframework

When I tried to add the string value to the list in the robot frame work. I am getting below error. Can anyone help me here?
Error:Expected argument 1 to be a list or list-like, got string instead.
${a}= 'H'
Append_to_list ${Elementlist2} ${a}

That error is telling you that ${Elementlist2} is a string, not a list. It must be a list if you are using Append to list

Related

How to ignore None value from list?

I am testing BE and when getting json path for some values I get None. I want to ignore them.
Remove values from list did not work for me.
Remove values from list ${list} None/${empty}/null
Are there any other ways to ignore None value?
I also tried to get from json values without null but did not work either. Showed an error
JsonPathLexerError: Error on line 1, col 41: Unexpected character: ?
${TARGET_TEXT}= Get Json Path ${RESPONSE} $.pipelines..filter.children..targetText[?!#.None]
You're close. You need to remove ${NONE} rather than ${EMPTY}
Remove values from list ${TARGET_TEXT} ${NONE}
Try this :
${list} = Evaluate [i for i in ${list} if i]

TypeError: string indices must be integers error in BERT model

I am trying to run a BERT model for a dataset of emotion annotated tweets. When running our command in cmd line to begin this process, this type error is thrown
Going to the line the error is shown, how could we fix this error in order for the model to work?
Our data files are two column csv files , the column on the left with the tweet and the column on the right with the annotated emotion in binary (0 for false 1 for positive)
How could we fix this?
Let me know!! Thanks
The variable emb is a string. An index looks like this:
>>> mystring = 'helloworld'
>>> print mystring[0]
>>> 'h'
The above example uses the 0 index of the string to refer to the first character. Strings can't have string indices (like dictionaries can). So this won't work:
>>> mystring = 'helloworld'
>>> print mystring['stringindex']
TypeError: string indices must be integers
I suggest you try to print the data and check what you are trying to do.

Can't Assign Value of Excel cell To variable in Robot Framework [duplicate]

I'm writing a test case in robot framework. I'm getting the response in below json string:
{"responseTimeStamp":"1970-01-01T05:30:00",
"statusCode":"200",
"statusMsg":"200",
"_object":{"id":"TS82",
"name":"newgroup",
"desc":"ttesteste",
"parentGroups":[],
"childGroups":[],
"devices":null,
"mos":null,
"groupConfigRules" {
"version":null,
"ruleContents":null
},
"applications":null,"type":0
}
}
From that I want to take "_object" using:
${reqresstr} = ${response['_object']}
... but am getting the error "No keyword with name '=' found" error
If I try the following:
${reqresstr}= ${response['_object']}
... I'm getting the error "Keyword name cannot be empty." I tried removing the '=' but still get the same error.
How can I extract '_object' from that json string?
When using the "=" for variable assignment with the space-separated format, you must make sure you have no more than a single space before the "=". Your first example shows that you've got more than one space on either side of the "=". You must have only a single space before the = and two or more after, or robot will think the spaces are a separator between a keyword and argument.
For the "keyword must not be empty" error, the first cell after a variable name must be a keyword. Unlike traditional programming languages, you cannot directly assign a string to a variable.
To set a variable to a string you need to use the Set Variable keyword (or one of the variations such as Set Test Variable). For example:
${reqresstr}= Set variable ${response['_object']}
${reqresstr}= '${response["_object"]}'
wrap it inside quotes and two spaces after =
There is a syntax error in your command. Make sure there is a space between ${reqresstr} and =.
Using your example above:
${reqresstr} = ${response['_object']}

Error: Result 1 must be a single string, not a character vector of length 0 when using "make_choose_all_table" from tidyREDCap

I am receiving an error when using make_choose_all_table() from the tidyREDCap package and I'm hoping someone can help me understand what it means. When I export my data from REDCap using REDCapR and then run the code make_choose_all_table() the error below it pops up. The "boo_do_co_no" is my checkbox variable that I am trying to make a table with.
What does the error mean and how do I fix it?
library(REDCapR)
data <- redcap_read()
library(tidyREDCap)
make_choose_all_table(data, "boo_do_co_no")
Error: Result 1 must be a single string, not a character vector of length 0
It needs to come out like the picture below
I am guessing that you are missing an argument within data <- redcap_read() When I run that line, data contains the function code for redcap_read(), not any data output that might come from the function when all the arguments are specified.
See ?redcap_read()

Can arguments be passed to List variable in ROBOT framework

My problem is:
I am trying something like this
${${variable}} Create List
${variable} --this will be passed as an argument.
I get the following error when I do it:-
No keyword with name '${${variable}}' found
To make a list use #{list}, but not ${variable}. To parse ${variable} to list, use something like this: #{list} ${first_variable} {seconn_variable}.
More info you can get here:
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.7.4#list-variables
Hope this would help you!

Resources