Exploring the capabilities of ngWebDriver to interact with a dynamic ng-repeat through Selenium

I'm currently in the process of automating a web interface that contains frames built with Angular JS. I'm specifically looking to access an ng-repeat located within dynamic columns.

Here's a snippet of the DOM structure I'm dealing with :

 <div class="containCol__col column-animation col0" ng-repeat="column 
 in sbCtrl.SlideboardStore.columns track by` 
 sbCtrl.getUniqueColumnId(column)" column-id="emptydata" ng-class=" 
 {'enabled': column.showNewCardInput, 'containCol__col__collapsed': 
 column.isCollapsed}" style="opacity: 1;">

As you can observe from the code snippet, the ng-repeat pattern is dynamic and tied to the Column ID:

ng-repeat="column in sbCtrl.SlideboardStore.columns track 
bysbCtrl.getUniqueColumnId(column)

Here is my Selenium approach :

WebDriverFactory.getDriver().findElement(ByAngular.withRootSelector("#application-container").exactRepeater());

However, my dilemma lies in finding a suitable selector for the repeater since it's dynamic. I initially considered selecting the column first, but since it's not a frame, I am unsure of how to proceed.

Appreciate any help in advance.

Answer №1

Hey everyone, I'm excited to share that I was able to find the solution to the problem. By using Xpath, I successfully removed the dynamic part from the selector and selected the desired column. It worked perfectly!

I utilized the following code to locate the specific column in the web application:
WebElement repeater = WebDriverFactory.getDriver().findElement(ByAngular.withRootSelector("#application-container").exactRepeater("column in sbCtrl.SlideboardStore.columns"));

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

Exploring the power of Jasmine with multiple spy functionalities

I'm currently working on writing unit tests for an Angular application using Jasmine, specifically focusing on testing different scenarios within a function. The main challenge I am facing is structuring the test to accommodate various conditions such ...

Executing AngularJS Accordion event on a webpage

Hello, I am new to using AngularJS and I am currently working on implementing an accordion feature. The accordion is used to display a list of channels on the site. However, I am encountering an issue with the implementation. I want the accordion to be hi ...

intricate pattern matching tool for Angular

Can someone help me create a regular expression that can validate input in the format "S19/999999/090"? I need the input field to accept this specific type of input where the first character is an uppercase letter from A to Z, followed by two digits from 0 ...

Tips for adding a CSS class to an HTML element on-the-fly

As a newcomer to JavaScript and AngularJS, my question may be considered naive by some. I am currently working on a tutorial project involving AngularJS. Here is the HTML code snippet I am dealing with: <link href="http://netdna.bootstrapcdn.com/boo ...

Utilizing Express REST API with Postgres through the HTTP method

I am currently working on implementing REST APIs with Express and Postgres. I have a scenario where I need to delete all instances from a table based on the user_id foreign key, and then insert new instances with the same user_id. I'm unsure which HTT ...

Guide to attaching a click event in a subview of Backbone

I'm struggling with understanding event binding in a Backbone subview. Here's how my view is set up: TenantView = Backbone.View.extend({ events: { "click": "setActive" }, initialize: function() { this.parentEl = this.options.parent ...

Steps for triggering a re-render in a React component when an external value changes

I am currently working on a project that involves using Meteor and React. In my code, I have a class called WebRTC which handles all WebRTC-related logic: class WebRTC { this.isCalling = false; ... } In addition to the WebRTC class, there is ...

Transform a string into an array using JavaScript

Currently, I am dealing with an array: itemSku = ["MY_SERVICE","SKU_A","SKU_B"]; When passing this value to a component in Angular, the type of itemSku is being identified as a string. This prevents me from performing array operations on it. console.log ...

Error encountered: Difficulty rendering Vue 3 components within Google Apps Script

Currently delving into Vue and Vue 3 while coding an application on Google Apps Script. Following tutorials from Vue Mastery and stumbled upon a remarkable example by @brucemcpherson of a Vue 2 app functioning on GAS, which proved to be too challenging in ...

Error: The function of forEach is not applicable to todoList

_serilizedList(todoList){ let serialized = '*My to-dos:*\n'; todoList.forEach((t, i)=> { serialized += '*${i}* - ${t}\n'; }); return serialized; } Unexpected TypeError: todoList.forEach is not ...

Using Javascript to link various arrays filled with file paths and transforming them into an object in a distinctive manner

I've tried countless times to make it work, but it just doesn't seem to work... I have an array that contains multiple other arrays: let arr = [ ["Users"], ["Users", "john"], ["Users", "john", "Desktop"], ["Users", "john", "Docum ...

Does the code snippet "args = [temp[n] for n in array(index)]" in python involve a verification of temp[n]?

I am currently in the process of migrating from Python to Java. My inquiry relates to the purpose of the 'args' variable? args = [this.scrath[c] for c in this.connections(n)]; //Python Could it be interpreted as follows: [this.scrath[c] //ret ...

Why am I seeing back-end console errors that are related to my front-end?

Recently, I encountered an error message that prevents me from using 'import' in my front end code when trying to execute 'node index'. This issue never occurred before, and it only arose when I returned to this project. In my backend ...

What are the steps to initiate the Chrome browser with Selenium automation?

I am having trouble finding a basic code that will open the Chrome browser. I am using Version 123.0.6312.106 (Official Build) (64-bit). I have checked https://chromedriver.chromium.org/downloads but could not find a compatible Chromedriver for my version. ...

Guide on incorporating a dropdown menu within a Jssor slider

I am facing an issue with trying to include a dropdown menu inside the Jssor slider. The menu does not drop down when placed inside it. Here is the code snippet: <head> <script src="jquery.js"></script> <script src="jssor.slider.min. ...

Utilizing Angular.JS to apply the attribute selected="selected" to a specific option within a field

I am facing a situation where I have a scope object that consists of various Ratings that can be chosen from a dropdown: $scope.ratings = [{ id: 1, name: "Good", value: 9}, { id: 2, name: "Bad", value: 1 }]; The specific object I am rating looks like thi ...

Tips for Establishing Communication Between Two Dynamic Canvas Elements

How do I establish communication between two animated canvas elements? I have created two HTML5 canvas animations using Adobe Animate CC. Both of these animations are placed on a single HTML page. I am able to call functions from within the animations and ...

Switching a numerical value from a string to an integer and then representing it in binary form as a string

I am in the process of developing a program that mimics the tabulation method (Quine McCluskey). My current challenge involves converting input from String format to Integer format and then back to String format (specifically in Binary form). An error has ...

React Module cannot be found: Error: Unable to locate - import paths

New to coding and currently working on a website using React. Encountering three errors persistently: ERROR in ./src/Components/Pages1/Home.js 6:0-50 Module not found: Error: Can't resolve './Components/Cards/Cards1.js' in 'C:\Use ...

add element into the center of the div

I am attempting to insert an element (such as a div) in the middle of another div and directly after two line breaks. Below is an example of my code. The length of the div may vary. <html> <head> <title></title> <script ...