Utilize Protractor to input keystrokes into the BankID desktop application

Currently, I am facing a minor issue and wondering if someone could assist me.

In Sweden, we use Protractor to create automated tests for our trading platform. One of the features on our site is the ability for customers to utilize BankID for authentication and login purposes.

Upon clicking the "Login with BankID" button, an application pops up where users can input their password and click "Authenticate".

Take a look at our BankID login interface here

Now, my questions are:

  1. Is there a way for me to send keystrokes to the password field within this application?
  2. How can I simulate a click action on the "Auth" button?

Your assistance in resolving these issues would be greatly appreciated.

Answer №1

Utilize keyboard actions when working with protractor for web automation tasks.

Please note that this method will only work if your cursor is directed to the text box of the installed application. Otherwise, this solution will not be effective.

To input the password, use the command

browser.actions().sendKeys('//Your password').perform();

To navigate within the application, utilize the TAB key by using

browser.actions().sendKeys(protractor.Key.TAB).perform();

Once you reach the auth button, press ENTER using

browser.actions().sendKeys(protractor.Key.ENTER).perform();

Consider adding some small delays (sleep) after each action. While it's not guaranteed, it's worth a try.

I hope these tips help you in your automation tasks.

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

Warning: TypeScript linter alert - the no-unused-variable rule is now outdated; however, I do not have this configuration enabled

After 3 long months, I came across a warning in a project that was being refreshed today. The warning says "no-unused-variable is deprecated. Since TypeScript 2.9. Please use the built-in compiler checks instead." Oddly enough, my tsconfig.json file do ...

Building a customizable class from scratch

I am currently working on developing configurable classes that come with default values, but allow for configuration changes if needed. The concept involves creating an instance of a class by calling its type specified in the static properties of the Test ...

The issue with converting a string into an object in Typescript

I am having trouble converting the JSON response from the websocket server to a TypeScript object. I've been trying to debug it but can't seem to find where the error lies. Can anyone assist me in resolving this issue? Below is the code snippet ...

"Enhancing User Experience: Implementing Internationalization and Nested Layouts in Next.js 13.x

In the midst of working on a cutting-edge Next.js 13 project that utilizes the new /app folder routing, I am delving into the realm of setting up internationalization. Within my project's structure, it is organized as follows: https://i.stack.imgur.c ...

Is there a formatting error when pulling data from an API using Angular?

The data retrieved from the API follows this format: { “array1”:[ {"id”:1, ”someProperty”:”A"}, {"id":2, "someProperty”:”B”} ], “array2”:[ {"id”:1, ”anotherProperty”:”foo”, ”lastProperty”:”foo2”}, ...

How can I enhance the performance of my Selenium code in PyCharm (Python) to make it run faster?

My code is running very slow and I can't figure out why. Any suggestions for improvement would be greatly appreciated! from selenium import webdriver from InfoApp import keys import time def order(k): driver = webdriver.Chrome(executable_path=&apo ...

Ways to integrate npm dependencies into your Cordova plugin

Currently working on implementing a Cordova plugin called core-cordova found in this repository. This particular plugin has a dependency on another NPM package. The issue arises after installing the plugin in my app using: $ cordova plugin add @aerogears ...

How can we determine the type of InertiaFormProps in Laravel Inertia?

I have a webpage with a useForm hook implemented, featuring a multi-step form split into separate components. Here's an example: export default function create(){ const form = useForm({ name: '', content: &ap ...

How can I establish a connection to a Unix socket path using a connection string with Slonik?

Hey there! I encountered an issue while attempting to connect to a Google Cloud database using slonik: const pool = createPool( `socket:userName:password@/cloudsql/teest-123986:europe-west3:test?db=dbName` ) The error message I received was: error: throw ...

Enhancing the level of abstraction in selectors within Redux using TypeScript

Here is a custom implementation of using Redux with TypeScript and the connect method. import { connect, ConnectedProps } from 'react-redux' interface RootState { isOn: boolean } const mapState = (state: RootState) =&g ...

AmplifyJS is throwing an error: TypeError - It seems like the property 'state' is undefined and cannot be read

I am currently working on integrating the steps outlined in the Amplify walkthrough with an Angular cli application. My app is a brand new Angular cli project following the mentioned guide. My objective is to utilize the standalone auth components a ...

Is it possible to create an instance in TypeScript without using class decorators?

As per the definition on Wikipedia, the decorator pattern enables you to enhance an object of a class with additional functionalities, such as: let ball = new BouncyBall(new Ball()) The Ball object is adorned with extra features from the BouncyBall class ...

Identifying Button Clicks with Selenium and C# WebDriver

Currently, I am utilizing selenium with IE for automating web testing. On my webpage, a form gets filled out and then a button is clicked using the following code: driver.FindElement(By.CssSelector("td.ne-fieldvalues > input[type=\"button\"]" ...

Strategies for constructing or refining an object array with specified key and value from within a typescript object array

Is there a way to extract specific keys and values from an object array by filtering out those with "id" and "level" in TypeScript? Let's break it down with an example: The original object array is structured like this: [{ op: AND id:0 level: ...

Error: Unexpected top-level property "import/order" in ESLINT configuration

I'm in the process of setting up a guideline to include one blank line between internal and external imports. .eslintrc.json: { "parser": "@typescript-eslint/parser", "env": { "es6": true, " ...

Is it necessary to sanitize input fields manually in Angular 6?

Is it necessary for me to manually sanitize all user inputs, or does Angular handle this process automatically? In my login form, the data is sent to the server upon submission. Do I need to explicitly sanitize the data, or does Angular take care of sanit ...

Can a "fragile export" be generated in TypeScript?

Testing modular code can be challenging when you have to export things just for the purpose of testing, which can clutter your code and diminish the effectiveness of features like "unused variable" flags on compilers or linters. Even if you remove a usage ...

changing an object into an array using Angular 2's TypeScript

I am currently facing an issue where I have an object within another object, and my goal is to convert the inner object into a string separated by commas. However, when I attempt to do so, it results in an infinite loop. After making an observable http re ...

Update current properties of objects

I'm feeling like I'm going crazy and could really use some assistance. My predicament involves a function that looks like this: private generateTimeObject(firstObject: someInterface, secondObject?: someInterface) { let firstTime; let secondTi ...

Accessing specific elements in Typescript 3.5 using indexes

I am looking to create a type-safe getter function that has the ability to return modified values while still being sound. class Foo { a: number; b: boolean; } function getProp<K extends keyof Foo>(o: Foo, p: K): Foo[K] { switch (p) { ca ...