Utilizing a lone web element per row on a responsive webpage: A guide

click here for imageCurrently using the latest version of selenium web driver. Is there a method to utilize a single webelement (as a list webelement) in order to access row data on a responsive web page?

For instance, consider the following CSS in the browser:

iPad resolution(1st div in html):

li > .csd-aabc-item > .terraVM-ResponsiveModel-container .terraVM-TableCard--truncated

iPhone resolution(2nd div in html) :

li > .csd-aabc-item > .terraVM-ResponsiveModel-container .terraVM-CompactCard

When utilizing @FindAll, it retrieves the list size for both locators. However, I only require it for one.

Answer №1

To conduct a partial class verification, one can verify the presence of a class that begins with terraVM and includes Card:

li > .csd-aabc-item > .terraVM-ResponsiveModel-container [class^=terraVM][class*=Card]

The symbol ^= indicates "starts with", while *= signifies "contains".

This approach may not provide a completely distinctive locator on your specific webpage, but it addresses the information given in the original question.

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

Testing Highcharts using Selenium WebDriver

Interested in verifying the precision of a Highcharts visualizing data pulled from a JSON file that I've already accessed, employing Python and Selenium WebDriver. Is there a way to extract Highchart data from the site? Regards, Evgeny ...

Create a hover effect on HTML map area using CSS

Is it possible to change the background color of an image map area on hover and click without using any third-party plugins? I attempted the following code: $(document).on('click', '.states', function(){ $(this).css("backgro ...

Tips for resizing images to fit different screen sizes on your website

I have a website with an image that is currently responsive thanks to bootstrap. The width adjusts properly on different devices, but I want the image to crop to the left and right when it's enlarged in this specific case. I've tried various tec ...

Floating boxes with a stationary top alignment

My HTML "toolbar" has multiple widgets displayed in a horizontal layout. Each widget is represented by a div element in the source code: <div id="widget1" /> <div id="widget2" /> <div id="widget3" /> To position these divs, I use float: ...

Selenium cannot activate a button

After doing some UI testing on my application, I encountered a problem. The login screen requires both a user ID and password to be inputted in order for the login button to be enabled using javascript. During recording of the test suite, the button gets ...

Is it necessary to terminate the FileChannel?

Encountered a problem with one of our utility classes today. This particular class serves as a helper for files and consists of static file copy routines. Below, you will find the relevant methods extracted along with a test method. The issue arises when ...

Tips for increasing the size of the SVG icon within Material UI iconButtons

Have you experimented with creating webpages using react.js along with the Material UI library? How can I adjust the size of an SVG icon? Recently, I developed a "create new" component, which consists of a material paper element with an add button on top. ...

Guide on how to style and arrange multiple checkboxes in both horizontal and vertical rows using CSS

Is it possible to align a collection of checkboxes both vertically and horizontally, even when the labels vary in size? I found an example that demonstrates vertical alignment. Click here to view. How can I neatly arrange these checkboxes so that they ar ...

Utilizing CSS to Implement a Background Image

Here is where I am looking to upload the image. Ideally, I would like to position my image to the left side of the text related to Food and Travel. You can view the image here. .block-title h3 { color: #151515; font-family: 'Montserrat', s ...

3D Animation for All Browsers

I'm currently working on creating a small browser-based game and I've been experimenting with animations to get the desired effect. So far, the animation works well in Opera and Edge, although there is a slight cropping issue in Edge. Unfortunat ...

Is the Prometheus instrumentation in Java or .NET set up to run the web server for metrics on a separate thread?

When integrating Prometheus instrumentation using a client library for Java like https://github.com/prometheus/client_java or .NET such as https://github.com/prometheus-net/prometheus-net, is the instrumentation set up to run its own metrics web server in ...

Is there a way to navigate down a webpage using selenium?

Here is the code snippet you requested: driver = webdriver.Chrome(chromedriver_path) #webdriver path driver.get('https://webtoon.kakao.com/content/%EB%B0%94%EB%8B%88%EC%99%80-%EC%98%A4%EB%B9%A0%EB%93%A4/1781') #website access time.sleep(2) driv ...

Python Selenium error: Element Not Found using Name locator:

I've been attempting to automate the login process for the website using Selenium, but I keep encountering an error. selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","sel ...

Modify the color of text in Bootstrap navigation bar

I am struggling to adjust the text color within my bootstrap links. I attempted the method mentioned in this post, but unfortunately it did not work for me. Can someone please guide me on how to successfully change the text color? Thank you. You can view t ...

Discovering elements with Selenium using partial By.Name method (in C#)

I've been attempting to develop a function that can locate an element through a Partial match using "By.Name". Unfortunately, I haven't been successful in getting it to work. I've experimented with various regex permutations (found online), ...

Issues with border/padding and overlay in Packery Grid Layout

After spending some time working on a grid layout using the metafizzy isotope packery mode, I have encountered a few issues. To illustrate my problem, I have provided a link to a codepen below: http://codepen.io/anon/pen/EgKdpL Although I am satisfied wi ...

What's causing this element to overlap the previous one (apologies, once more)?

This is the code: <form id="the_form" action="">ev </div> <!-- final pay_block --> <div class="linea"/> <div class="spacer"/> The "linea" element is currently overlapping the buy button because a margin-bottom of 15px has be ...

Guice is failing to pass the `init-param` to the servlet

Looking to pass some initialization parameters to my servlet using Guice (MyServletModule.java): Map<String, String> params = new HashMap<>(); params.put("key1", "value1"); params.put("key2", "value2"); this.serve("/hi").with(H ...

Tips for avoiding word wrapping in text with white spaces

I am currently experiencing an issue with word-wrapping in my category names when there are two words separated by a space. Below is the CSS code snippet: .post-item .cat { height: 25px; display: inline-block; background: #CC0000; font-size: 11px; paddin ...

modifying the child divs contained in the main div

Hey there! I'm currently using Bootstrap to design an application and I've got the entire form inside a container. However, as I add more child elements within the container div, I would like the parent div to expand automatically to show all the ...