开发者

How can I write a function in Selenium and call it from another page?

I'm new to Selenium. I need to write a function in Selenium. This is a sample code. If it is correct, where we will save this file and what is the extension? How can I call this function from another page?

Please help me.

Can you give me sample code for a fu开发者_Go百科nction in Selenium?

package com.example.tests;

public void chk_test(String news){
   System.out.println("Success");
}


For starters, use an IDE, such as Eclipse. Within the same project, you should be able to create different packages, and import com.example.tests; within a class to use your function as chk_test(aString);

Hope this helps get you started. There are tons of articles/tutorials to get setup with Selenium RC using Eclipse, programming in Java.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜