Getting error 'No signature of method is applicable for argument types'

I am trying to get data from Excel from below method and create a Global variable on the fly using the below piece of code. But its giving an error.

.

Calling the method to create & set a value to the global variable.

Data is coming from excel:-
image

Everything is fine . But I am getting the method signature error:-

Im a newbie to automation!

You wrote this:

(new utilities.CreateGlobalvariable()).CreateGlobalvariable('ProductId', name)

Should rather write:

(new utilities.CreateGlobalvariable()).addGlobalVariable('ProductId', name)
1 Like

That was a very silly mistake on my part. Thanks a ton!.
However now im getting another error. Seems the Global variable was not created:-

What I want to achieve is to set the value i get into Global variable and pass it to the next test in the test suite :-


calling above from teh test case:-

The provideValidProduct method has code to create the GlobalVariable on the fly.

But are you sure your test case calls the provideValidProduct?

Maybe not.

Yes it does .The rest of the things are working fine in that test ,i.e. it is getting the data from excel,but its failing for creation of global variable

And here is my regression suite
image

You have this line:

CustomKeywords.'admin.CreateProduct.provideValidProduct'(Name, Description, Configuration)

This line implicitly assumes that the provideValidProduct method is declared as static.

On the other hand you showed the following code:

@ Keyword
def provideValidProduct(def name, def desc, def config) {
    ...  

As this clearly shows, the provideValidProduct method is NOT declared as static.

You have an inconsistency. Therefore you failed to invoke that method; then the GlobalVariable is not created.

Should the method be static or not? That is the question.

Oh I didnt know, No it was not declared as static . I have changed it to static. But it still didnt work

I can not see your code. Without reproducing your problem on my side, it is impossible for me to debug your code. Please try create a project with minimum set of keywords and testcase scripts to reproduce your problem (failed to create a GlobalVariable on the fly). Then make a zip file and attach it here.

Any issues to access please let me know

I downloaded the zip you provided, unzip it, open the project with Katalon Studio. I could open it.
I executed some test cases. All of the test cases does not work for me. The tests works quite strangely on my side. I do not think I can manage to make it work.

The project seems to be the whole set of your project, not minimized at all. I do not want this.

Please minimize it so that you and I can forcus onto a particular problem : you want to create a GlobalVariable on the fly, but you can not.

The problem be is it won’t work without the modules I gave u. I will try creating a rough piece of code trying to achieve the same thing. U can delete what I sent.

I think you would gain some Aha! while you try to create minimized/reproducible set of codes. You would be able to find an answer for yourself :wink:

2 Likes