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

learn more… | top users | synonyms

15
votes
3answers
44k views

A way to match on text using CSS locators

So I use xpath locators and slowly converting to CSS. I haven't found a way to do an exact match based on text. For example converting //a[text()='Log Out']. I know you can do css=a:contains('Log ...
8
votes
5answers
892 views

Is there any reliable way to write unit test against the CSS itself for a site?

is that a feasible idea? what tools do you use? what do you call this kind of testing?
3
votes
2answers
13k views

Selenium - Find exact text match using CSS locators

According to A way to match on text using CSS locators, we should be able to use "^$" to find exact text match using CSS locators. But with div class="item"><div ...
2
votes
3answers
83 views

Correct CSS selector for selenium

Which css selector's correct for the following HTML code ? <li class="active editing" data-index="0"> <div class="view"> <input class="edit"/> </li> I'm trying to get ...
2
votes
1answer
293 views

How do I test that external CSS does not contain an absolute URL via unit test?

I have been given the task of validating that we do not have any http:// URLs in our CSS or HTML documents. I've created a selenium IDE test that looks at src & href attributes as well as script ...
2
votes
2answers
85 views

CSS visual regression - do I need to store screenshots in git repository?

There is a technique to check if something visually not broken in HTML and CSS markup - visual regression testing. We do following steps: Check everything is ok. Create a test "reference" (creating ...
1
vote
1answer
498 views

Selenium: Click on input-field with complicated selector

I need the right direction to click on a input field. When I copy the CSS path I get the following: html body#root div#box div#content div#C_INTERNAL_OBJECT-98286949812.container ...
1
vote
1answer
30 views

What are the debug tools that i can use for GUI Automation on Internet Explorer?

Are there any tools similar to firebug/firepath that i can use to test the locators on the internet explorer browser? I was running an xpath which works in firefox but fails in IE.
1
vote
1answer
314 views

Dynamic ID selecting text from dropdown

I have a situation I'm trying to handle. I am using webdriver, C#. The image above is the dropdown I want to select from. This is how it works, to select from the element, first click it and a text ...
1
vote
1answer
11 views

CSS locator for body text between span tags in selenium

How do I build a CSS locator for the "Add Photos/Video" text between the span tags. I need to perform a click event on this element.
1
vote
0answers
40 views

Select a dropdown element with dynamic ID using Webdriver, C# [duplicate]

I have a situation I'm trying to handle. I am using webdriver, C#. when I tried using the CSSSelector it is just reading the parameter as a string. Kindly look into it.This is the HTML. <div ...
0
votes
1answer
54 views

Finding column with certain text works using xpath but fails with cssSelector

I was trying to locate table column containing text 'Name', and it fails while using cssSelector with 'Unable to locate element' but works with xpath. I tried all the 3 below options with different ...
0
votes
2answers
206 views

Selenium Webdriver - finding element on IE 11

I'm trying to assert a 'name' on my page, to assure the right name is displayed: public static OpenQA.Selenium.By Name = (By.CssSelector("p")); Assert.AreEqual("Name", ...