-
Notifications
You must be signed in to change notification settings - Fork 61
Use the browser-perf node module, and define custom actions.
You can use something like the following for scrolling a custom element. Define this in the actions key.
actions : [browserperf.actions.scroll({
scrollElement: 'document.getElementsByClassName("myclass")[0]'
})]
A full example can be found as a gist.
You can use the prescript
option to log in and ensure that a cookie is set. When running the test, the cookie will still be used and you will be able to test the page as a logged in user. For example, with the node API, pass the following to the prescript
option.
... // other config options for browser-perf
prescript: browserPerf.actions.login({
username: {
field: 'CSS_for_Username_textbox_in_form',
value: 'Username_to_be_typed'
},
password: {
field: 'CSS_for_Password_textbox_in_form',
value: 'password_to_be_typed'
},
submit:{
field: 'Submit_Button_CSS_Selector_In_Form'
}
})
Perfjankie is a module built on top of browser-perf that saves the results and HTML to display graphs in a CouchDB database. We use it for generating graphs like this and this.
The steps to debug the issue would be
- Is selenium running?
- Can you open a browser using selenium? You can use the wd module directly to see if selenium works.
- Run browser-perf with a
debug
flag andverbose
flags. This will leave the browser windows open after the tests and give you extensive logging. - Contact us if you still encounter issues.
Browser-perf uses the debug module for debug logging. To get a stack trace, set the environment variable DEBUG
to *
using export DEBUG=*
(Mac/Linux) or set DEBUG=*
(Windows). If you then run browser-perf, you would get logs that would be helpful in debugging the actual issue.
Here are some tips to ensure that the tests you run result in consistent results
- Ensure that only one user scenario is run. For example, a simple page scroll will result in more consistent results than a test that runs scrolls on multiple pages, loading one page after another.
- Ensure that you disable all metrics that you may not be interested in.