我无法从控制台执行输入。
@Test public static void abcde1() throws Exception { Run1 run123=new run1(); ApplicationContext context = new ClassPathXmlApplicationContext( "test-beans.xml"); ServiceClient serviceClient = (ServiceClien)context.getBean("customer"); System.out.println(serviceClient); run123.setup(serviceClient);//setup belongs to another class }
2.这个函数属于另一个Run1。(BufferRead只在那里定义,它以System.in作为输入。
public void setup(ServiceClient serviceClient) throws Exception { System.out.println("enter some "); System.out.println("Enter the UserName the user wants to login With"); String userName = bufferRead.readLine(); System.out.println(userName); }
在程序中我通过引用 testng.xml 来调用这个测试
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>