Protractor is having difficulty locating the alert

Whenever I click the "Update" button on my web application, an alert with a success message pops up. However, Protractor seems to be unable to locate it in the code.

<div class="toast ng-scope toast-success" ng-mouseout="restartTimer(toaster)" ng-mouseover="stopTimer(toaster)" ng-click="click(toaster)" ng-class="toaster.type" ng-repeat="toaster in toasters" style="">
<!-- ngIf: toaster.showCloseButton -->
<div class="ng-binding toast-title" ng-class="config.title"/>
<div class="toast-message" on="toaster.bodyOutputType" ng-switch="" ng-class="config.message">
<!-- ngSwitchWhen: trustedHtml -->
<!-- ngSwitchWhen: template -->
<!-- ngSwitchWhen: templateWithData -->
<!-- ngSwitchWhen: directive -->
<!-- ngSwitchDefault: -->
<div class="ng-binding ng-scope" ng-switch-default="">The update process was completed successfully</div>
<!-- end ngSwitchWhen: -->
</div>
</div>
<!-- end ngRepeat: toaster in toasters -->
</div>

Therefore, the issue lies in Protractor not being able to find the specific element:

<div class="ng-binding ng-scope" ng-switch-default="">The application record has been successfully updated</div>

What could possibly be causing this problem?

I am using the following locator:

element.all(by.repeater('toaster in toasters'))

Answer №1

  • Utilize ExpectedConditions in your code to ensure Protractor waits for alerts to appear before interacting with them. If the issue persists, consider the following alternative:
  • Experiment with updating or downgrading the toaster versions to see if that resolves the problem.

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

Operating Node.js - leveraging mongoose promises - iterating through

I am currently facing an issue with mongoose in conjunction with node.js. In my model, I only have the group supervisor's ID, but in this route, I also want to add the supervisor's name to a variable (this name is stored in the Group model). I ha ...

I'm looking to create a redirect feature using a QR code that will direct users to a specific page within my Flutter app. How

When the user scans the QR code, they will be taken to a secret internal page that can only be accessed through this specific link. I attempted to use various libraries such as , but it did not achieve the desired outcome. ...

Having trouble notifying a json object following an ajax request

My project involves using a PHP file that contains an array with multiple values. Additionally, I have an HTML page that features a single input field. A listener is set up to detect changes in the input field. Once a change occurs, an AJAX call is trigge ...

Preventing chromedriver from taking focus on Ubuntu 16.04 LTS with Selenium

My selenium script is designed to scrape a website. However, I am facing an issue where each time the script opens a new link, Google Chrome launches a new window and takes focus away from other open windows on my Ubuntu 16.04 LTS system. I have attempted ...

Using Vue.js for displaying strings with line breaks

I'm struggling to include a line break in string interpolation within my printed HTML this.externalUsers = data.externalUser.map(element => `Name: ${element.firstName} ${element.lastName}\n <br><br />Email: ${element.email}`); In ...

Automatically disconnect from the application upon logging out of Google account

I've successfully set up an express server that uses Google OAuth for user authentication. One interesting challenge I'm facing is how to handle the scenario where a user logs out of Google services (like Gmail) and automatically log them out fro ...

Is there a way to direct the particles towards the camera while rotating, and trigger an alert message when they intersect in Three.js?

I'm working on implementing an event handler for particles that triggers an alert message on a sphere, always facing the camera. I am looking to achieve something similar to this demo (and making sure it works on IE 9+). Here is the code snippet I ha ...

Exploring the benefits of utilizing ChartJs within a VueJs component

I'm currently working on using Chartjs to create and control a chart within a Vue component. I'm feeling a bit lost as to where exactly in the script tags I should initialize the chart instance var myChart = new Chart(ctx, {...}); after importing ...

How to Retrieve a Unique Element from a Multidimensional Array using Knockout.js

I am currently working on extracting the 0 index of a nested array in a multidimensional array. My approach involves using a foreach binding to display states and cities within a <ul>. Here is the code I have so far: http://codepen.io/ntibbs/pen/vNM ...

Looking to retrieve the value of an input element within an ng-select in Angular 6?

Currently, I am working on a project where I aim to develop a customized feature in ng-select. This feature will enable the text entered in ng-select to be appended to the binding item and included as part of the multiselect function. If you want to see a ...

Unable to delete component from an array (slice, Vue.js)

I'm currently working on implementing dynamic addition and removal of components in Vue.js. I've encountered an issue with the slice method, which is supposed to remove an element from an array by the provided index. To modify the array, I am us ...

Tips for enabling fullscreen mode in a YouTube embedded video with just a button click

Imagine you have an iframe embedded on a webpage, allowing users to watch a YouTube video: <iframe width="640" height="390" src="https://www.youtube.com/embed/--id--" frameborder="0" allowfullscreen></iframe> Now, is there a way to inclu ...

Creating a running text (marquee) with CSS is a simple and efficient way to make

I encountered a significant challenge while delving into CSS animation. My goal is to create a "transform: translate" animation that displays text overflowing the content width as depicted in the image below. https://i.stack.imgur.com/sRF6C.png See it i ...

How to use jQuery to delete specific table rows while keeping the first row safe from removal

Currently, I have a jQuery script that successfully removes table rows when a button is clicked. However, I want to prevent the button from removing the first row of the table. Is there a way to achieve this? $("#remove").click(function(event) { ...

I thought I had successfully installed the HTML test runner, but I was disappointed to find an error message stating, "ModuleNotFoundError: No module named 'HtmlTestRunner'."

After using pip to update HtmlTestRunner in Python 3.6, I encountered an error when trying to run a Python file through the command prompt. Here is the traceback of the error: File "seleniumUnitTest.py", line 3 import HtmlTestRunner ModuleNo ...

insert information into a fixed-size array using JavaScript

I am attempting to use array.push within a for loop in my TypeScript code: var rows = [ { id: '1', category: 'Snow', value: 'Jon', cheapSource: '35', cheapPrice: '35', amazonSource ...

Issue with Guild Member Add functionality in discord.js is not functioning as expected

I'm facing an issue with my code where the bot does not send a welcome message when a user joins, despite having everything set up correctly. Even when a user leaves, there is no farewell message being sent either. Here is the code I am using: bot.on ...

What is the best way to send a function to the child component?

I need help with passing a function to a child component in React. Specifically, I have a component with a modal for confirming the deletion of an item. How can I pass a delete function to the modal so that when the "Agree" button is clicked, it triggers t ...

Developing an interactive single-page website

My goal is to develop a PHP web application with an overlay container that features dynamic fields/forms. The idea is for users to fill out the form without being redirected from the main page they are on. Imagine being able to report a page error on a w ...

Utilizing a Text Box, HTML, and Javascript to Showcase a PDF within an iFrame

Is there a way to add a form on a Sharepoint page that prompts users to input the URL of a PDF document, which will then be displayed in an iFrame on the same page? I've come across some code that achieves this with an image, but I'm struggling ...