RobotFramework: Keyword 'Selenium2Library.Input Text' Error Keyword 'Input Username' expected 1 arguments, got 0 - selenium-ide

Code:
Input Username
[Arguments] ${username}
Input Text login_username_id ${username}
Error:- Keyword 'Input Username' expected 1 arguments, got 0
May i know why am i getting this error?

Pass in self as the first argument in your method. Something like:
def input_username(self, arg1):

The error message is telling you exactly what the problem is: your keyword Input Username expects exactly one argument, but the place where you are calling it is only providing one argument.

Related

Error in #(filename)readAndPreprocessImage(filename)

I tried
trainingFeatures=activations(net,trainingSet,featureLayer,'MiniBatchSize',32,'OutputAs','columns');
but it gave me this error:
imds.ReadFcn=
#(filename)readAndPreprocessImage(filename)
Undefined function 'readAndPreprocessImage' for input arguments of type 'char'.
Error in #(filename)readAndPreprocessImage(filename)
I am assuming that its the issue of filename, what should I put there?

Copying an AD user with New-ADUser -Instance from Get-ADUser returns cannot convert value error

I am trying to copy an AD user account as part of a larger script. It has worked in the past but is currently throwing this error:
Cannot bind parameter 'Instance'. Cannot convert value "CN=Test Tester,OU=etc..." to type
"Microsoft.ActiveDirectory.Management.ADUser". Error: "Cannot convert the "CN=Test Tester,OU=etc..."
value of type "Deserialized.Microsoft.ActiveDirectory.Management.ADUser" to type
"Microsoft.ActiveDirectory.Management.ADUser"
The relevant code:
$user_to_copy = test.tester
$user_to_copy_instance = Get-ADUser $user_to_copy
New-ADUser -Instance $user_to_copy_instance
I don't understand why it throws an error when trying to convert the value type as I'm following the documentation for the "-Instance" parameter as found here: https://learn.microsoft.com/en-us/powershell/module/addsadministration/new-aduser?view=win10-ps
Any help is greatly appreciated, thank you!
It sounds like you're running this in a remote session. When you get an object back from the server, because it went through serialization and deserialization, it's not really that object anymore. It's a "property bag": just the properties, but without the methods that go along with the real type. You can read more about that here if you'd like.
To avoid that, you can try running both commands in the same line:
New-ADUser -Instance (Get-ADUser $user_to_copy)
I don't know 100% that it will work, but it makes sense that it might.

Attempt to add 'foo' to a static workspace, when using input command?

I wrote a program that contains the input command in order to get the required info from user. but when I try to read the input, I encounter with this error:
Attempt to add "g" to a static workspace.
and my code is:
baseFunctionType = input('Please enter the type of base functions?(Polynomial = P ,Gaussian = G)');
I read some posts about the same error message, but with different context they were in! Is there any way to do that!(I don't want to use GUI)
Thanks.
You probably need to use the following syntax given that your input is a string:
baseFunctionType = input('Please enter the type of base functions?(Polynomial = P ,Gaussian = G)','s');
Check the documentation for more details.

search a name in dataset error :Undefined function 'eq' for input arguments of type 'cell'

I load a file which has some columns with data.The first line contains ,CITY,YEAR2000 .
The first column has name of cities.The other columns contain number data.
I am trying to search for a specific city using:
data(data.CITY=='Athens',3:end)
where
data = dataset('File','cities.txt','Delimiter',',')
but I receive an error
Undefined function 'eq' for input arguments of type 'cell'.
--------UPDATE-----------------------------
Ok, use :
data(find(strncmp(data.CITY,'Athens',length('Athens'))),3:end)
Have you tried with using strncmp tangled with find?
I would use it this way
find(strncmp(data.CITY,'ATHENS',length('ATHENS')))
EDIT
Other opportunities to exploit would encompass strfind
strfind(data.CITY,'ATHENS')
EDIT 2
You could also try with
data(ismember(data.CITY,'ATHENS'),3:end)
This should lead you to the results you expect (at least I guess so).
EDIT 3
Given your last request I would go for this solution:
inp = input('Name of the CITY: ','s')
Name of the City: ATHENS
data(find(strncmp(data.CITY,inp,length(inp))),3:end)

symfony2 embedded collection edit form

I created an embedded collection of another entity in a form, the idea would be that when you edit or erase up to 'demand' also would edit the 'products' that belong to it, my creating form is ok, but the editing it gives the error :
Catchable Fatal Error: Argument 1 passed to MaisAlimentos\DemandaBundle\Entity\Demanda::setProdutosDemanda() must be an instance of Doctrine\Common\Collections\ArrayCollection, instance of Doctrine\ORM\PersistentCollection given, called in /var/www/maa/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php on line 347 and defined in /var/www/maa/src/MaisAlimentos/DemandaBundle/Entity/Demanda.php line 130
I read on some forums, the solution is remove type of the setter, I got other error:
Catchable Fatal Error: Object of class Doctrine\ORM\PersistentCollection could not be converted to string in /var/www/maa/src/MaisAlimentos/DemandaBundle/Entity/Demanda.php line 136
my code
http://pastebin.com/WeGcHyYL
OK, so you've found the solution for your original problem.
The second one comes from a typo/copy-paste error.
In the line 162 on your pastebin code:
$this->$produtosDemanda = $produtosDemanda;
should be
$this->produtosDemanda = $produtosDemanda;
So no $ sign after $this->.