Monitor and follow a specific row in a table on a web client page that does not have a unique identifier, while this table continuously fills with data in real

Currently, I am engaged in the development of a web client-GUI-automation testing tool using selenium with x-path and CSS.

The web client features a panel area located at the bottom. Within this panel lies a table that lacks a unique identifier for its rows.

Here's the scenario: Upon adding a virtual machine (VM) via the web client GUI and clicking on the finish button, the table within the lower panel will display the task initiation details in its first row.

The table structure includes columns such as task name, date, and target in row[1]. When only one task is in progress, there will be a single row containing these details.

In order to verify the task commencement, I check if tr[1]td[1] = "Create_Vm".

However, when multiple VMs are created simultaneously – let's say 3 VMs (vm1, vm2, vm3) – the table would include:

tr[1]td[1]

tr[2]td[1]

tr[3]td[1]

  • All labeled as create_vm.

The challenge arises when attempting to track a specific task - like vm2 - since there isn't a unique ID for the table row. How can this tracking be achieved using selenium-xpath-css?

Answer №1

Suppose the VM name is located in the initial column, and the web element you are targeting is situated in the second column. A method to achieve this would be as follows:

//*[contains(text(),'vm2')]../../td[2]

Determine the column by utilizing text containment and then navigate to its parent node before proceeding to the desired column.

Answer №2

Should the items be shown in the sequence they were initiated, follow this command: //table//tr[x+1]/td[1] If in reverse order, use the following instead:

//table//tr[position()=last()+1-x]/td[1]
Here, x represents the virtual machine number.

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

Troubles with aligning text and images in the footer due to CSS discrepancies

Can anyone assist me with a formatting issue I am facing? I currently have a footer that contains text and a Facebook icon. However, I am having trouble aligning the Facebook icon directly to the right of the text. If anyone could offer some guidance, it ...

Retry failed tests with Specflow's rerun feature

Looking to retry failed tests in SpecFlow using the SpecFlow.Retry plugin by DamirAinullin: https://github.com/DamirAinullin/specflow-retry Below is my App.config file configuration: <?xml version="1.0" encoding="utf-8" ?> <co ...

Is there a way to choose an item from a dropdown menu in Selenium using Python if the option's element is not clickable?

I am encountering an issue while trying to select an item from the dropdown menu. The options that I need to choose from are not selectable and display an alert message stating, "Alert: This element is not interactable through selenium(automation) as it is ...

Learn the method of centering flexbox vertically by using the flex-wrap property with the value

enter image description here I am currently working on a to-do list project. Whenever I add a folder, it appears vertically aligned. (click the /Bottom bar/ button -> it will display a folder in the /Homecomponent/) Each new folder I add goes further ...

Utilize Python along with selenium to manipulate mouse beyond the bounds of a web page

I want to test the exit intent form on a specific page: To trigger the popup window, I need to move the mouse pointer outside of the webpage area and then enter text into the form in the popup. How can I effectively move the mouse outside of the web page ...

Tips for dynamically updating a value on a webpage when the ID or class is constantly changing using VBA and Selenium

Can anyone help me with updating a specific value on a private website where the ID keeps changing? I'm unable to use FindElementByID as the number inside the ID keeps changing. Any suggestions would be appreciated. I have attempted to print the attri ...

Having trouble extracting text from a div element using Python

for item in driver.find_elements_by_xpath("//div[@class='d3-tip n']"): custom_style = item.get_attribute('style') transparency = custom_style[:32] if transparency = ...

What is the best way to combine node-sass and sass-autoprefixer in a project?

I'm struggling to implement the code in my package.json. Here is the code snippet: { "name": "nodesass", "version": "1.0.0", "description": "", "main": "index.js", "dependencies": { "node-sass": "^4.11.0" }, "devDependencies": ...

How can RobotFramework extract and verify the text within each span element of an alert?

I am facing an issue with an alert that contains multiple span elements with different error messages. My task is to verify if a specific message is present in that alert. For instance, in the image provided, one of the span elements displays the error mes ...

A guide on embedding text onto the bottom of an image in Material-UI GridList using Reactjs

I'm currently developing a Mern-stack application and using Material-UI for the frontend. My GridList is functioning correctly, but I want to position my description text at the bottom of the image rather than in front of it. However, when I try to a ...

"Efficiently Triggering Multiple Events with One Click in JavaScript

Hey everyone, I could use some assistance. I'm trying to execute multiple events with a single click. Currently, I can change the image in my gallery on click, but I also want to add text labels corresponding to each image. Whenever I click on a diffe ...

Incorporating a background image into a mat-dialog

After spending some time on the mat-dialog documentation, I discovered that I can add a background image to the mat-dialog using panelClass: 'my-class' to customize its appearance. This applies the class my-class to the div with the class cdk-ove ...

Ways to display content alongside an image

Is there a way to verify if an application is running on another server by displaying an image it provides? The challenge is that altering the content of the image is not an option. If the image is not provided, can I show an alt attribute indicating that ...

Enhance Bootstrap: adjust button width based on fluid text width

Incorporating Bootstrap 5 framework, I have designed a card that showcases brand information along with a navigation button on the right side. https://i.sstatic.net/25QVr.png When the description is brief, the button aligns perfectly in a single line. Ho ...

Having trouble navigating to a newly opened tab in Chrome with Selenium

After clicking on a link in the current page, I noticed that a new tab opened but the focus did not shift to that tab. I tried two different methods to switch tabs, but neither of them worked as expected. This issue occurred while using Chrome as my brow ...

Accordions housing Bootstrap 3 pills in a sleek design

I'm working on integrating pills and an accordion in Bootstrap 3. Everything seems to be functioning correctly, but there are a couple of issues I am encountering: When the accordion is open, clicking on another tab closes the accordion. I would li ...

Modify the content of an element upon hovering over a different element

I have a set of three buttons and I want the text displayed in a box to change based on which button is being hovered over. If no button is being hovered, the default text should be "See details here". Is there a more efficient way to achieve this function ...

Alter the div's HTML content once the Ajax operation is completed

I have a div element that looks like this: <div class="progress" id="progress-bar"></div> I am using the following JavaScript code along with an ajax call to retrieve some data. The data returned is 0, however, the content is not being added ...

An error has been encountered: WebDriverException

Can anyone help me figure out what's going on with my chromedriver ??? ***Here is the error trace *** Exception has occurred: WebDriverException Message: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort fi ...

Importing styles from an external URL using Angular-cli

How can I load CSS styles from an external URL? For instance, my domain is domain.eu but my site is located at sub.domain.eu. I want to use styles that are stored on the main domain (common for all sites). The example below does not work: "styles&qu ...