Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [css]

Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents.

0 votes
2 answers
15 views

CSS selector with multiple same classes under different divs

Example of the Problem: <div> <h2> one <div> <h2> two <div> <h2> three I want to select the second h2 with css. I know there is something like h2:nth-child(),...
random's user avatar
  • 1
0 votes
1 answer
757 views

Selenium C# Locate Both Data QA Attribute And CSS Class

How do we locate both Data QA Id and CSS Class using Selenium C# ? We're trying to locate both a DataQAid attribute and also see if its class ng-invalid, (Angular Material Textbox Error) This is what ...
Artportraitdesign1's user avatar
0 votes
1 answer
357 views

how can i capture src in xml by using cssSelector or Xpath?

how can i capture src in following xml by using cssSelector or Xpath ? <INPUT src="/TelsimGlobal/Menu/image3.gif" type=image> i tried to execute following ones but always faced with "Unable to ...
santino87's user avatar
0 votes
1 answer
443 views

CSS parsing to check color value [duplicate]

I need to make a script that checks if all h1 tags in a page are of a certain hex color. If they are not, test fails. What are the available options for doing this? I'm using selenium with java
user avatar
1 vote
1 answer
1k views

how to Iterate a List of links?

This "Books" link shows that it has the following xpath: /html/body/div/div/div/aside/div[2]/ul/li/a Then follows the catalogue categories: Travel, Mystery, etc. Reading the xpath above I see ...
Thufir's user avatar
  • 367
0 votes
2 answers
1k views

Verify Text using CSS or Xpath

I am new to automation, Selenium Web Driver and am practicing code using Amazon. I want to verify my logged in user name (Hello, Nichole) on the Amazon Home Page but anything I enter using CSS or ...
nchll's user avatar
  • 13
2 votes
2 answers
7k views

Can't find any element using CSS selector with Selenium on Python

I'm running a script on vodafone.co.uk, but I can't find any element using the CSS Selector. browser.get("http://freesim.vodafone.co.uk/") browser.find_element_by_css_selector("#...
Beter's user avatar
  • 131
-3 votes
1 answer
2k views

XPATH FACEBOOK How can i get xpath or css selector ? - selenium/java [closed]

I automated some facebook functions for pratice selenium, but i can't click on search options. How can i try this ? Search: elements:
skape's user avatar
  • 21
3 votes
1 answer
4k views

How do I identify a specific <div> by id with Selenium?

I want to grab everything within this div with an id of "storytext": <!-- END ID="STORY-META" CLASS="STORY-META" --> <div id="storytext" class="storytext storylocation linkLocation"> ...
Thufir's user avatar
  • 367
33 votes
7 answers
22k views

What makes a good selenium locator?

When automating UI tests with Selenium, it is often not absolutely clear what method and what locator to use to locate an element. Some locators are less reliable, less readable than others. And, ...
alecxe's user avatar
  • 11.4k
6 votes
2 answers
630 views

Testing CSS styles and design elements of website

How to find the CSS attributes for website. For eg: I have a testcase where I need to test the styling and design of a Button for webpage. How can I retrieve the elements, if for example I need find ...
WiredTheories's user avatar
3 votes
2 answers
235 views

A testing tool that determines whether a section of HTML matches a certain style?

This may be a long shot, but suppose I have a requirement that a given section of a web page be bolded. That could be done with <b> or <strong> tags, or even a heading tag assuming that ...
Jordan Reiter's user avatar
1 vote
3 answers
4k views

How to locate Facebook POST button using Java Selenium WebDriver?

Code: driver.findelement(By.xpath(".//*[@id='js_2y']/div[4]/div[2]/div/div[2]/div/button")).click(); Every time I try by locating XPath, it's gives an exception, could not locate element. May 04, ...
Saurav Prasad's user avatar
2 votes
1 answer
65 views

Can Css Selector be used to write customized path using tag name traversing?

I wrote a xpath for the following using tag name traversing This is the xpath I wrote - .//form[@class = 'form-horizontal']/div[3]/div/input and it works fine but when I tried to write this in for ...
som ghosh's user avatar
1 vote
3 answers
878 views

What CSS locator can I use when there is no good ID, Name or Class?

How do I build a CSS locator for the "Add Photos/Video" link so I can perform a click event on it? The ID is js_42 which varies and the class is _$qtm_fb2ReactComposerAttachmentSelector_MEDIA which ...
ilm's user avatar
  • 386

15 30 50 per page