Hi,
Below is the code that i ran on selenium RC using eclipse
IDE and java coding.:
package source;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
import com.thoughtworks.selenium.*;
public class parameterized extends SeleneseTestCase
{
private Selenium browser;
public static void main(String []args)
{
String arr[] = new String[5];
arr[0]= "bert";
arr[1]= "regular";
arr[2]= "copyonly";
arr[3]= "doert";
arr[4]= "inter";
parameterized obj = new parameterized();
obj.setUp();
obj.login_parameterize(arr);
}
@BeforeSuite
public void setUp()
{
browser = new DefaultSelenium("localhost",4444, "*chrome",
"http://goolge.com");
browser.start();
browser.open("http://goolge.com");
browser.waitForPageToLoad("30000");
browser.windowMaximize();
browser.open("/");
browser.click("gb_23");
}
@Test
public void login_parameterize(String[] arr )
{
for(int i=0;i<=5;i++)
{
for(int j=0;j<=2; j++)
{
browser.type("//input[@id='Email']", arr[i]);
browser.type("//input[@id='Passwd']", arr[i]);
browser.click("//input[@id='signIn']");
browser.waitForPageToLoad("30000");
}
}
}
public void EnterValuesIntoTextField_CheckWithGetValue()
throws Exception
{
selenium.open("http://www.essaywriter.co.uk");
assertEquals("", selenium.getValue("id=textInput"));
selenium.type("id=textInput", "Text In The Field");
assertEquals("Text In The Field",
selenium.getValue("id=textInput"));
}
}
When i ran this test i got an error which says:
"Method login_parameterize requires 1 parameters but 0 were
supplied in the @Test annotation."
Any help is much appreciated.
thank
Gab
Answer / Shri Chandra Kushwaha
In the provided code, it appears that the `login_parameterize` method expects to receive an array of strings as a parameter, but no array was passed when calling the method in the TestNG test case. To fix this error, you should call the `login_parameterize` method with an appropriate array of strings when running the test.
| Is This Answer Correct ? | 0 Yes | 0 No |
Tell me what is automation testing?
What is test automation?
how we start automation testing in company?is there any document for it?what are the differnt fields contains in Automation plan?
Explain some automation testing tools.
Do you know what is a data-driven framework?
Describe some problem that you had with automating testing tool.
WHAT WE CAN NOT DO WITH QTP? GIVE 5 POINTS.(EXCEPT PERFOMANCE)
What is a framework for automation testing?
Does every software project need testers?
On what factors can you map the success of automation testing?
Which of the Test cases can be automated? can anybody tell me with an example.
What is ur goal when ur doing Performence Testing of an Web Application..?