Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Record tab key in web browser testing

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
edited December 2016 in SOAtest
Here are the instructions to capture TAB key in web browser testing

1) Close SOAtest if it's open
2) There are two copies of UserCustomizableOptions.js files - one for IE and one for Firefox - located under
<SOAtest Installation Directory>/plugins/com.parasoft.xtest.libs.web_VERSION#/root/browsers/ie
<SOAtest Installation Directory>/plugins/com.parasoft.xtest.libs.web_VERSION#/root/browsers/ff/extensions/wk@parasoft/chrome/content


where VERSION# refers to SOAtest version (ex: 6.2)

Add the following snippet at the beginning of UserCustomizableOptions.js file

CODE
_wk_BrowserDriver.prototype.doTabKey = function(locator) {
var element = this.findElement(locator);
if (_wk_browserVersion.isIE) {
  _wk_HTMLUtil._nativeTypeChar(element, "\t", 0);
} else {
  _wk_HTMLUtil.triggerKeyEvent(element, "keydown", 9, true);
  _wk_HTMLUtil.triggerKeyEvent(element, "keyup", 9, true);
  _wk_HTMLUtil.triggerKeyEvent(element, "keypress", 9, true);
}
}

4) Open up SOAtest
5) Make a new web recording test, and inside Browser Testing tool, select Other from Action drop down menu, and type TabKey to simulate tab button. Configure element locator to the element that you want to enter.

For more information on how to manually add a test, see the instructions for adding a browser test that presses the ENTER key: http://forums.parasoft.com/index.php?showtopic=2161 (but make sure to use the TabKey action rather than the EnterKey action).
Tagged:

Tagged