Record tab key in web browser testing

LegacyForumLegacyForum Posts: 1,669 ✭✭
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/[email protected]/chrome/content

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

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

_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: (but make sure to use the TabKey action rather than the EnterKey action).
Sign In or Register to comment.