Questions tagged [css]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
49 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 ...
0
votes
1answer
205 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
1
vote
1answer
196 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 ...
0
votes
2answers
298 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 ...
0
votes
2answers
3k 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("#frmNew > div:nth-...
-3
votes
1answer
725 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:
1
vote
1answer
2k 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"> ...
23
votes
6answers
13k 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, ...
5
votes
2answers
107 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 ...
3
votes
2answers
151 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 ...
1
vote
3answers
3k 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, ...
2
votes
1answer
48 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 ...
1
vote
3answers
762 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 ...
2
votes
2answers
167 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
67 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
0answers
97 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 class=...
1
vote
1answer
1k 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 div#mainPanel....
3
votes
1answer
668 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 ...
28
votes
3answers
177k 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 ...
12
votes
7answers
2k 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?