Assigning a date input value during a Protractor test

I am currently working on an Ionic hybrid mobile application and in the process of creating some protractor tests. For testing against a simulator version of the app, I am relying on Appium.

One particular challenge I've encountered involves a registration form with several inputs, including one for date input:

<input type="date" name="dob" ng-model="vm.register.dob" ng-max="vm.dobMax" required>

While I have successfully populated all text inputs using input.sendKeys("John Doe");, I seem to be encountering issues with the date input. I've tried various approaches, such as:

var dobInput = element(by.model('vm.register.dob'));
dobInput.sendKeys("01-01-2015");
dobInput.sendKeys("01012015");

Even attempting to trigger the native date picker by clicking on the input directly hasn't yielded results: dobInput.click();

Despite my efforts, I haven't been able to populate the date input with any value. Any insights on what might be going wrong?

Appreciate your help!

Answer ā„–1

Verify that the date format is in compliance with the approved input format, for instance:

dobInput.sendKeys("2015-01-01");

Answer ā„–2

To successfully access the by.model, consider updating your code to use the format item.name:

var usernameInput = element(by.model('input.vm.login.username'));
usernameInput.click();
usernameInput.sendKeys("example@domain.com");

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

Retrieving a database value in Node.js Firestore containing a space

Hello, I'm just getting started with node Js and I anticipate that it will be a smooth ride! Currently working on an application using node JS with Firestore where I need to retrieve data like "display name": James and "Age": 22 Since Age does not h ...

Table with checkboxes for row selection

Hey there, I've just set up a table with some values. My goal is to select all checkboxes with the first checkbox and uncheck them. print "Content-type: text/html; charset=iso-8859-1\n\n"; my $script = qq{ \$('#id').change(fu ...

Vuetify - Best practices for managing click events with <v-btn>?

As a newcomer to vuetify and vue, I am currently trying to understand how to handle a click event on a <v-btn>. (Using vue 2.6.10 and vuetify 2.0.0) (I was surprised to find that I couldn't locate a single functioning code snippet, despite sear ...

Best practices for effectively dismantling a Paper.js Scope

In my web project, I am utilizing multiple Paper.js canvases by creating a new scope for each of them. Due to the AJAX-driven nature of the site, I need to get rid of unnecessary instances when switching between subpages. Unfortunately, there is no built-i ...

Instructions for turning an HTML table cell into an editable text box

Essentially, I'm looking to enable users to click on the table and edit the text within it. I found inspiration from this Js Fiddle: http://jsfiddle.net/ddd3nick/ExA3j/22/ Below is the code I've compiled based on the JS fiddle reference. I tho ...

The upcoming development does not involve creating an entire HTML webpage using on-demand static site generation (SS

Iā€™m encountering a problem when utilizing getStaticPaths and getStaticProps to create an on-demand SSG for a sharing page. My setup involves Next v12.1.0 and React 17.0.2. After building a specific /[id] page, I can retrieve the data but the HTML output ...

Challenges encountered when attempting to round significant amounts with ng-currency

In my current project, I am utilizing the ng-currency library to handle currency values. While it serves its purpose, there are some specific requirements that need to be addressed: The currency value should not be negative. It should not exceed 999,999, ...

404 Error: The requested resource is not available on the web API

I have been attempting to utilize Web Api to send/receive data from the server. In my WebApiConfig.cs file: config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "{controller}/{act ...

Modify the button label as you input text into the textfield

I have a styled button along with an input field next to it. I want the button value to update dynamically as the user enters text in the input field. What is the easiest way to achieve this? This is my form: <form> <div class="span-3" id="b ...

Click the edit button to access the options in the material table

https://i.stack.imgur.com/Inyow.png Currently, I am utilizing Material Table within Reactjs to display the table Data. However, I have encountered a hurdle where I need to alter state upon clicking on the edit option/icon. My objective is not to modify th ...

Retrieve text from an element using jQuery when triggering "mouseenter" on a different element

Is there a way to retrieve the text from an element while simultaneously triggering a 'hover' action on another element? Here is an illustration: I am trying to gather all available colors, but the color names are only visible upon hovering ove ...

Performing a validation on data fetched using a .load() function

I've been struggling with a persistent issue that I just can't seem to solve. So, here's the situation: I have a blog post on a CMS that I'm developing. The content is saved within a div with its own unique ID. When the user clicks an ...

employing lodash's _find function to determine the existence of a value

Trying to utilize the lodash function to determine if it meets the if statement criteria. Even when the code encounters a 'return false' result, it continues to execute the _find function without returning the boolean value in the scope.onToggle ...

Tips for resolving the "trim" of undefined property error in Node.js

Looking to set up a basic WebAPI using Firebase cloud functions with express and TypeScript. Here's the code I have so far: import * as functions from 'firebase-functions'; import * as express from 'express'; const app = express( ...

Validating clients with Bootstrap 4 before submitting via ajax

My project follows the guidelines of Bootstrap 4, so I aim to reuse existing code whenever possible instead of writing my own. I have a form (shown below) that triggers an AJAX post request upon pressing the Submit button. The response is a JSON object con ...

Having trouble with blurriness in the SVG image loading on three.js

Currently, I am using loadTexture (THREE.ImageUtils.loadTexture('/images/areaYellow.svg')) to load SVG images. However, when I zoom in on the image, it becomes blurred. Is there a way to load the image without this blurriness? I am currently work ...

What is the best way to use jQuery to add items to my unordered list based on user

Here is the HTML code I have created: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name=& ...

Why aren't my cookies being successfully created on the frontend of my application when utilizing express-session and Node.js?

Having trouble setting cookies while using express-session in my MERN stack project. When accessing endpoints from frontend localhost:3000 to backend localhost:8080, the cookies do not set properly. However, everything works fine when both frontend and b ...

Sliding divider across two div containers with full width

Seeking a JavaScript/jQuery function for a full page slider functionality. The HTML structure I'm working with is as follows: My objectives are twofold: Both slide1 and slide2 should occupy the full width of the page. Additionally, I am looking for ...

Adding a scrollable feature to a Bootstrap Modal seems to be generating additional unnecessary pages at the

I need help with my scrollable bootstrap modal that has a print button on top. When the user clicks the button, I want to print the modal content. Here is the code snippet: HTML : <div class="container-fluid" id="body-noPrint"> /* HTML BODY CON ...