Tips for extracting column data from a grid with Protractor

I'm having trouble retrieving the information from a specific column in my grid.

Does anyone have any alternative solutions to the following method:

element.all(by.repeater('col in colContainer.renderedColumns track by col.uid').column('Entity'))
    .getText()
    .then(console.log);

Answer №1

Consider implementing the following code snippet:

element.all(by.css('tr')).get(rowNumber).all(by.css('td')).get(colNumber).getText();

Answer №2

Perhaps you could consider implementing something along these lines:

 PageGrid.all(by.repeater('item in grid.items')).then(function (rows) {
                rows.forEach(function (row) {
                    row.all(by.repeater('column in row.columns')).then(function (columns) {
                        columns[3].getText().then(function (columnText) { //Retrieving the desired column value based on its position in the Grid, starting from 1.
                           console.log(columnText);
                        });
                    });
                });
 });

In this scenario, the "PageGrid" acts as the unique identifier for the entire Grid structure.

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

Issue with datepicker functionality not operational for newly added entries in the table

@Scripts.Render("~/bundles/script/vue") <script> var vueApp = new Vue({ el: '#holiday-vue', data: { holidays: @Html.Raw(Json.Encode(Model)), tableHeader: 'Local Holidays', holidayWarning: true, dateWarning: true }, methods: ...

Navigation for GitHub pages

I've been working on this for what feels like forever. The persistent Error 404 I'm encountering is with the /Quest/questlist.txt file. https://i.sstatic.net/NYYRa.png Here's the code snippet I've been using: ``// QuestCarousel.tsx ...

Customize chrome's default shortcuts with JavaScript

I'm working on an application that requires me to override some shortcut keys in the Chrome browser. While I'm able to create custom shortcuts to trigger alerts like in this Stackblitz example, I'm having trouble overriding a few default sho ...

Issues with invoking C# event through ajax communication

Whenever I click the Button, an Ajax method is called that triggers a webmethod on the server side. However, currently, the [WebMethod] is not being executed as expected. Below are the snippets of both the Ajax and server-side code: Ajax code $(document ...

Retrieve an image from the internet and use it as input for a Python Selenium script to upload to a file input field

I am attempting to utilize Python requests to download a file from the web and then pass this file to a Python Selenium webdriver keys into an HTML file field. The code I currently have is shown below. image = requests.get('https://theartgalleryumd ...

Merge arrays in map function based on label and aggregate information

In my possession is an array filled with data from various streaming channels, categorized by shift (Morning and Afternoon). I dedicated the night to experimenting with different functions like reduce, but unfortunately, I hit a wall and couldn't gra ...

Attempting to include an additional choice in a dropdown menu

I have been facing an issue with the code snippet below where it removes all the options in my edit form. However, after removing the options, I am trying to add a default option. Despite my attempts with the given code along with .add and .prepend meth ...

How to trigger a hover effect on a div and its child simultaneously using HTML and jQuery

Here's my concept: I want the text to be contained within div elements with an integrated image, rather than just having fading in and out pictures. Here's my attempt: #first{ position: absolute; } #second{ position: absolute; -we ...

Simplified React conditional rendering made easy

Currently, I am utilizing React 16 with Material-Ui components. In my root component, I have a requirement to load a tab and a view conditionally based on a property. Although I have managed to implement this functionality, the code appears quite messy a ...

Finding the right way to cancel a Firestore stream within a Vue component using the onInvalidate callback

Currently, I am utilizing Vue 3 to develop a Firebase composable that is responsible for subscribing to an onSnapshot() stream. I have been attempting to unsubscribe from this stream by invoking the returned unsubscribe() function within both watchEffect ...

Execute code after the CSS has been loaded, but before the images start downloading

My website is experiencing a challenge. Downloading images is taking too long, with the complete website taking around 20 seconds to fully load on my system. A loader is displayed but only hides once the complete website is loaded (after 20 seconds). Whe ...

Combine multiple arrays of JSON objects into a single array while ensuring no duplicates

Trying to combine two JSON arrays into one without duplicates based on date. The jQuery extend() function isn't doing the trick, so looking for an alternative solution that avoids nested $.each statements due to potential large dataset size... [ ...

What steps can I take to make this JavaScript burger menu function properly?

I've been following an online tutorial to spice up my navigation bars a bit, but I'm having trouble getting my burger menu and animations to work. I've included the JS file above </body> (I also tried moving it into the <head>). ...

Acquiring JSON data nested within another JSON object in D3

After looking at this reference, I am attempting to integrate similar JSON data into my webpage. The challenge I am facing is that my JSON contains nested JSON. Here is an example of how my JSON structure looks: { "nodes": [ {"fixed":true,"classes": null, ...

collaborate and coordinate a territory among various components on a map

I'm currently working with an array of elements that are being drawn on a canvas. export function useCanvas(){ const canvasRef = useRef(null); const [ elements, setElements] = useState([]); const [ isHover, setIsHover] = useState(false); ...

What is preventing the slider handle from being moved?

Having trouble getting the slider handle to move when testing it out. Could use some assistance on this matter. Included a Fiddle link for your reference. JavaScript Code: var current_plan = {}; var plans = [ { 'name' : 'Business&apo ...

Leveraging angular.forEach for JSON Iteration

In my app and controller, I am working on creating a "flow chart style" question and answer system. To keep track of the current question and answer, I am using variables like $scope.ActiveQuestion and an array named $scope.ActiveAnswers. I am struggling ...

The onchange event is failing to trigger any JavaScript function

I am facing an issue where the onchange event of a dropdown menu is not triggering at all. I even tried redirecting it to a simple JavaScript function for testing purposes, but that didn't work either. I'm struggling to find a solution. Below is ...

Tips for generating a new page using Angular 2

I recently set up a fantastic admin project using Angular 2. Check out the demo of the project here. I'm facing an issue while trying to create a new page within this project! You can see exactly what I'm trying to accomplish here. The error I& ...

Confirming Identity using Fetch

In my React application, I am utilizing Javascript to interact with a database table called "users" which contains a boolean field indicating the user type (such as patient, doctor, etc). My goal is to check if a user exists and is not classified as a "pat ...