The function sendKeys with protractor's Key.Tab input is failing to function

Currently, I am using Protractor along with JavaScript. The issue I'm facing is that the SendKeys(protractor.Key.TAB) function does not seem to be tabbing out from the input field.

Please find below the HTML tag for the input field:

<td>
  <input class="ng-pristine ng-untouched ng-valid" type="text" placeholder="Add a new member" ng-blur="addMember()" ng-model="newMemberText"/>
</td>

Here is the code snippet for Protractor that I have written:

this.When(/^add member to registration$/, function () {
    var abc= element(by.model('newMemberText'));
    abc.sendKeys('print');
    abc.sendKeys(protractor.Key.TAB);
});

I have also attempted using abc.sendKeys(KeyboardEvent.TAB), but unfortunately both methods are not functioning as expected.

Answer №1

To enable the desired function, pass the key you want to the browser component in this manner:

browser.input().sendKey(protractor.Key.ENTER).execute();

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips on how to send a parameter to a middleware function in Express JS

// route for editing state details app.get("/map/:symbol/edit", isLoggedIn, function(req, res){ State.findOne({symbol: req.params.symbol}, function(err, state){ if(err){ console.log(err); } else { res.render("edit", {state: state}); ...

``Is there a more SEO-friendly option instead of using an iframe?

I am looking for a solution to easily share my content with other websites without the issues I currently face. Presently, I use an iframe which poses two problems: <iframe width=“540”; height=“700” frameborder=“0” src=“http://www.energi ...

Adding External JS Files to a Node.js Project

I recently discovered how to incorporate a JS file into Node JS. However, I am facing an issue with two JS files in particular - hashing.js and encoding.js. Within encoding.js, I have the following code: exports = exports || {}; exports.encoding = encodi ...

Preventing page loading in Selenium Webdriver: A comprehensive guide

Upon logging into an account on a website, I encountered an issue where clicking on a button led to a page continuously loading without displaying the next page. My goal is to halt the script execution if the page keeps loading without any response for a ...

The read more button is not functioning properly when used in conjunction with the <br>

Can someone help me debug an issue I'm facing with my code? I have created an HTML tab that contains multiple DOM elements, each with a "Read More" button. Everything works fine when it's just plain text, but as soon as I add tags within the p ...

React UseEffect - Triggering only when data has been updated

In my current situation, I am facing a dilemma with the useEffect hook. I need it to not run on the initial render, but only when specific data is rendered, such as home.matchsPlayed and home.winHome. This is what my code looks like: useEffect(() => ...

What causes a statically generated page to appear without any style when transmitted to the client?

After setting up the Next.js official boilerplate with npx create-next-app and opening it in the browser, I observed that the static HTML document lacks styling: https://i.stack.imgur.com/mna6K.png I am concerned about potential FOUC issues. How can I en ...

Performance of obtaining image data

Is anyone else experiencing a significant lag when trying to retrieve the state of a single pixel on the canvas? Take a look at my JS code below: var state = ctx.getImageData(x,y,1,1).data; state = 'rgba(' + state[0] + ',' + state[1] ...

Pressing the button does not register outside of the loop function

Just as the title says, I am experiencing an issue where my click event is not being triggered when I click on my button. The button itself was created using a JavaScript loop. Interestingly, I found that when I placed my click event function inside the lo ...

Utilizing a controller's promise feature to invoke a service function in AngularJS

Incorporated within my base controller is a service called Uom. The service is invoked within the controller in the following manner: Uom.get_measurement_unit_conversions().then( function( measurement_unit_conversions ) { // Executing some operations ...

Is there a way to monitor transactions within the Tron blockchain?

Is there a way to effectively track transactions on the Tron blockchain network without constantly making HTTP requests? Specifically, I am looking to monitor transactions associated with my own address, but have been unable to find a viable method. I atte ...

Exploring the functionalities of ng-value and ng-model in text input form fields

As I create a form to update information in a database, everything seems to be functioning properly. The selected data is being retrieved correctly; however, it is not displaying in the text inputs on the webpage. Although the information appears correct ...

Parameter within onClick function that includes a dot

I'm attempting to design a table that enables an onClick function for the Change Password column's items so my system administrator can adjust everyone's password. Each onClick triggers the "ChangePassOpen" function which opens a modal with ...

What is the meaning of MVVM "binder" and how is it used?

I've been conducting research online to gain a deeper understanding of the MVVM architecture in general. According to Wikipedia, the key components of the MVVM pattern are: Model View View Model Binder This is the first time I have come across the ...

Utilizing Jquery and Ajax to create a dynamic dropdown selection feature based on dependencies from a JSON file

Could you assist with the code snippet below? I have a form where each dropdown list depends on the selection above it. Based on the user's selection, the appropriate data should display in the subsequent dropdown list. I am trying to make dropdown l ...

A SecurityError occurred when trying to access the CSS stylesheet using Selenium on Firefox. The error message displayed that the CSSStyleSheet.cssRules getter was not permitted to

I am currently utilizing Selenium with Java along with either Chrome or Firefox drivers. FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("javascript.enabled", true); profile.setPreference("security.fileuri.strict_origin_policy", false ...

Directive in Angular lacking a defined scope

Can you explain the significance of a directive definition lacking scope:? Additionally, what would be the equivalent if scope: were to be included? For instance, consider this example: .directive('myCustomer', function() { return { templ ...

Karma-coverage examines the test coverage of JavaScript files rather than TypeScript files within Angular 2

I am facing an issue with checking test coverage in TypeScript files using Istanbul and setting test thresholds via karma-coverage. The problem arises because karma-coverage checks test coverage in JavaScript files instead of TypeScript, which leads to mis ...

Undefined variables are returned by declarations in a script setup after an asynchronous call with top-level await

Here is the structure of my Nuxt 3 / Vue 3 component using script setup: <script setup> const content = await useFetch('/api/items/published').then((res) => res.data) const items = await content.data.items const issues = awai ...

An Ajax call navigates to the index.html page

Could you please assist with an issue I am facing? I have written the code below to make an ajax request to a specific link. However, instead of executing the ajax call using a POST request, the page is being redirected to index.html with the link in the ...