I use selenium to register some performance tests on my site. e.g. login time, request time, etc. I have a sample script written in the Selenium IDE. Now I run one Selenium RC (java).
public void testNew() throws Exception { selenium.open("/jira/secure/Dashboard.jspa"); selenium.selectFrame("gadget-10371"); selenium.type("login-form-username", "username"); selenium.type("login-form-password", "pw"); selenium.click("login"); selenium.waitForPageToLoad("30000"); selenium.selectWindow("null"); selenium.click("find_link"); selenium.waitForPageToLoad("30000"); selenium.removeSelection("searcher-pid", "label=All projects"); }
How do I log in, how long do you press the login button to fill the loaded screen?
That's what I came up with, will it be the exact time?
long starttime = System.currentTimeMillis(); selenium.waitForPageToLoad("30000"); long stoptime = System.currentTimeMillis(); long logintime = stoptime - starttime; System.out.println(logintime+" ms" );
java performance logging selenium
ajoe
source share