Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

CSS locator for attribute "onclick" works only case-sensitive #2146

Open
lukeis opened this issue Mar 3, 2016 · 7 comments
Open

CSS locator for attribute "onclick" works only case-sensitive #2146

lukeis opened this issue Mar 3, 2016 · 7 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 2146

What steps will reproduce the problem?
1. Start Firefox 3.6.18 + Selenium IDE 1.1.0
2. Write a valid test with a locator like this: css=a[onClick] --> works
3. Change the locator to: css=a[onclick] --> doesn't work

I've also tested in FF5 where the locator works correctly case-insensitive. So this
could be a FF3.6-only problem.

Selenium version:
OS: Windows 7 64-bit
Browser: Firefox
Brower version: 3.6.18
Selenium-IDE: 1.1.0

Reported by schlueter.tobi on 2011-07-28 08:48:06

@lukeis lukeis closed this as completed Mar 3, 2016
@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by Samit.Badle on 2011-07-28 10:24:32

  • Labels added: Component-IDE

@lukeis lukeis changed the title placeholder empty issue CSS locator for attribute "onclick" works only case-sensitive Mar 3, 2016
@lukeis lukeis self-assigned this Mar 3, 2016
@lukeis lukeis reopened this Mar 3, 2016
@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Is the application you are automating HTML4, HTML5 or XHTML? (I think in this case it
is important.)

Reported by adamgoucher on 2011-08-05 14:16:17

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

The application/website is delivered as XHTML and the charset is utf-8.

Reported by schlueter.tobi on 2011-08-05 19:55:41

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by simon.m.stewart on 2011-08-08 07:58:32

  • Labels added: GettingInvolved

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Since it is XHTML, two comments...
- if your attribute in the generated html is onClick, it is /not/ valid XHTML where
attributes must be lowercase (per the W3C spec)
- and since this is XHTML, case matters

See http://element34.ca/blog/case-sensitivity-of-attribute-names for the digging I
did last week.

Reported by adamgoucher on 2011-08-08 11:50:17

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Hi Adam,

sorry if I broke your brain ;)
Your research is a helpful summary to discuss this issue. I've attached a very essential
website + the corresponding selenium-test. Load the test in both FF3.6 and FF5.0 using
Selenium IDE 1.1.0. Now watch the different results. This leads me to three questions:
- Why does FF3.6 match the 1st and 2nd command?
- Why does FF5.0 match the 4th command?
- Why does FF5.0 match the 3rd command, but you'll get an error by hitting the "Find"
button?

The Gecko engine in both Firefox versions does work correctly. Try it yourself by running
following code in the Firefox command shell on the attached 'website.html':
document.getElementById('mylink').onclick;
document.getElementById('mylink').onClick;

Now my brain is broken, too :D

Reported by schlueter.tobi on 2011-08-08 13:41:23


- _Attachment: [website.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-2146/comment-6/website.html)_ - _Attachment: [seleneseTest.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-2146/comment-6/seleneseTest.html)_

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 17:44:25

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant