2

I am trying to insert data in the ORG,

I am creating Dectionary of **kwargs

${Dist}=    Create Dictionary    Project__c=${Project_Id}    Description__c=Test    Data_Type__c=Percent    Type_of_Results__c=Input    Reporting_Frequency__c=Monthly    
${Indicatory_Id}=    Salesforce Insert   Indicator__c = ${Dist}

I am getting below error,

Keyword 'cumulusci.robotframework.Salesforce.Salesforce Insert' expected 1 non-named argument, got 0.

2 Answers 2

0

The Salesforce Insert Robot keyword takes the name of the sObject as its first parameter. There's an example in create_contact.robot:

    ${contact_id} =       Salesforce Insert  Contact
    ...                     FirstName=${first_name}
    ...                     LastName=${last_name}

To make this work with a dictionary, you'd instead do

${cont} =        Create Dictionary  FirstName=${first_name}  LastName=${last_name}
${contact_id} =       Salesforce Insert  Contact  &{cont}

Note the & to unpack the dictionary into individual keyword arguments, and the first argument being the name of the sObject.

1
  • Thanks, it worked with '&{cont}' Commented Feb 18, 2020 at 5:25
0

From Stack Overflow, Run Process throws error “expected at least 1 non-keyword argument, got 0”:

This problem can occur when arg1 or arg2 contain symbols that Robot Framework itself recognises. Make sure you escape those with a backslash.

For example, see the following command:

curl <args> "<url>/download?job=<name>"

This will result in "Keyword 'Process.Run Process' expected at least 1 non-keyword argument, got 0." The issue is, that Robot Framework thinks the = is an assignment, so you need to escape it:

curl <args> "<url>/download?job\=<name>"

Note the job\=<name> instead of job=name. There is no need to add multiple spaces between a command and its arguments.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .