当前位置: 动力学知识库 > 问答 > 编程问答 >

selenium - Return type Object

问题描述:

I am using data provider as part of my selenium script to validate multiple logins for an application. The code for the same is

@DataProvider(name="wordpressdata")

public Object[][] passData()

{

Object[][] wordpress = new Object[2][2];

wordpress[0][0] = "admin";

wordpress[0][1] = "demo123";

wordpress[1][0] = "admin1";

wordpress[1][1] = "demo123";

return wordpress;

}

In the above code, I did not get the return type mentioned is "Object". What is Object here and what is its significance. Why cannot I have some other name for Object[][] like Data[][].

Thanks!!

网友答案:

You are using testNG @DataProvider which must return Object[][], see here for details.

And the Object class is the parent class of all the classes in java by default. See here for explanation.

分享给朋友:
您可能感兴趣的文章:
随机阅读: