Skip to content
Advertisement

Java (Silenium) – import statement done however method is not visible

I am relatively new to Java and Selenium.

I have a project (Selenium) created by other developer.

  1. I created my Java class:
JavaScript
  1. The class which method SupplierPortalLogin() I want to use is called
JavaScript
  1. In my class on the top I have put a statement:

import com.resmed.application.GoScripts.tests.LoginTest;

  1. In my method,
JavaScript

When I use the method SupplierPortalLogin(UserName,TempString) I have an error message,

The method SupplierPortalLogin(String, String) is undefined for the type ST_VladsSteps.

  1. I can see in the project that other Java classes use the same import com.resmed.application.GoScripts.tests.LoginTest; statement and use this method within their methods.

Please, help me to understand what I am doing wrong.

Advertisement

Answer

In my method @When("^User keys in "([^"])" and "([^"])"$")

Your cucumber step required two arguments but you are passing single argument to the method userProvidesUserNameAndPassword

Current code:

JavaScript

Updated code:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement