--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-develo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
WebComponents and HTML5 widgets are going to be very interesting for us in general, but luckily I brought this up during a face to face with Simon in the Autumn of last year.
ahh, html5... http://www.w3.org/TR/html-markup/input.html Proposal: Overload WebElement.sendKeys() to allow passing in a DateTime object (as appropriate to client language). The client binding will then send across the wire a well formatted ISO 8601 datetime string. Like: "2013-04-02T14:58:33Z" The driver implementations can then interpret this appropriately for their input as needed. Currently only WebKit implements this ~ so Safari, mobile Safari and Chrome *right now*. Firefox / IE treat the field as a type=text. I'll ashamedly say I don't know what Opera does. Essentially I've already done part of this implementation in the atoms (for type=date): https://code.google.com/p/selenium/source/detail?r=bc59c1aea536de63174dc7328e8cb54fb947f7f6 https://code.google.com/p/selenium/source/detail?r=6790a0b4e2a4e6959b76e55cbb04ae18d031467d Client bindings would need updating. Let me know what everyone thinks (especially you spec writers out there). -Luke -- You received this message because you are subscribed to the Google Groups "Selenium Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to selenium-develo...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
If sendKeys(DateTime value) is implemented for <input type=”date”/> etc., I would strongly recommend the wire protocol and the Webdriver spec require the timestamp to be in RFC3339 date-time form, and ideally restricted to UTC (i.e., “yyyy-mm-ddThh:mm:ss[.nnn…]Z” only). Even for <input type=”datetime-local”/> (and with the appropriate trimming for more coarsely-grained types). Calendrical issues in software tend to be not well thought out in advance, and if there’s one thing this business should know by now, it’s that programs can only be trusted to operate in a fixed, explicit time zone, translating to other values only at the human-focused edges.
Ross
P.S. If anyone has any clout in the HTML Working Group, they need to understand that <input type=”time”/> defining its value as an RFC3339 partial-time is a mistake. They should really use full-time, otherwise the browser et al. have to guess the value from 24 possibilities. RAP
--
As I thought more about this, I realized that choice of API style (sendKeys(DateTime) or sendKeys(String)) doesn’t address the interpretation of the value, which was my primary concern. The question of how the browser drivers are supposed to treat the value received over the wire protocol for <input type=”date”/> etc. fields exists regardless of how the programmer specifies the value. The question is a matter of preference as long as some time zone is specified (“…Z”, “…+04”, etc.), although I’d argue from a cleanliness perspective that UTC-as-…Z is the right answer for the wire protocol and the spec. But values that lack an explicit zone specification are essentially undefined, and could have serious interpretation problems in current-day scenarios: how should “2013-04-10T08:51:00” be interpreted when a CI system in Europe is running a test through a cloud-based test provider hosted in Amazon’s US-West region? Even leaving out cross-zone usages, I would hate to have IEDriver interpret that as EST/EDT, ChromeDriver as PST/PDT, and OperaDriver as CET/CEST.
Ross
--
Anyone?
This is a conversation that keeps on rearing its head in random ways. We've seen it manifest here as "what do we do about date inputs", and there's another on going discussion about multiple file uploads going on too. I'd like us to have a strategy for dealing with these in a way that's consistent with our goals of keeping the API manageable and yet one that leads developers to Do The Right Thing. Using strings that are magically interpreted is pretty opaque, and I'm not keen on that one bit. I regret doing that with the file uploads, since it set a bad precedent.Our main problem is this:Or, put another way: there's an absolute ton of types, and we need to handle them. Our changes will be in two parts: one to the wire protocol, one to the user facing APIs. Although I realize that these are separate, for now I'm smooshing both cases together.Things that I'm considering:1) These will, by definition, degrade to straight text boxes on older browsers. We can continue to treat as text boxes and just tell users to use formatted strings.
2) We extend WebElement with strongly typed methods to handle dates, files, colours and ranges. We then extend the wire protocol, clearly defining how these are translated to user friendly values. And we spell "colour" with a "u" in the protocol if needs be. This also implies getters.
3) Add new wire protocol methods and add some role-based interfaces to WebElements, allowing users to cast them to whatever is appropriate. The wire protocol changes would be as with "2", with the addition that if we're returning a WebElement that represents an INPUT we also send the type attribute on the wire so we can bind the correct interfaces to the created WebElement instance.
4) We acknowledge that these new types are probably implemented using the Shadow DOM, and we make users delve into the Shadow DOM to interact with the elements.
My thoughts are inlineOn Fri, Apr 19, 2013 at 12:10 PM, Simon Stewart <simon.m...@gmail.com> wrote:
This is a conversation that keeps on rearing its head in random ways. We've seen it manifest here as "what do we do about date inputs", and there's another on going discussion about multiple file uploads going on too. I'd like us to have a strategy for dealing with these in a way that's consistent with our goals of keeping the API manageable and yet one that leads developers to Do The Right Thing. Using strings that are magically interpreted is pretty opaque, and I'm not keen on that one bit. I regret doing that with the file uploads, since it set a bad precedent.Our main problem is this:Or, put another way: there's an absolute ton of types, and we need to handle them. Our changes will be in two parts: one to the wire protocol, one to the user facing APIs. Although I realize that these are separate, for now I'm smooshing both cases together.Things that I'm considering:1) These will, by definition, degrade to straight text boxes on older browsers. We can continue to treat as text boxes and just tell users to use formatted strings.This is a consistent way that we are currently doing with other things.
2) We extend WebElement with strongly typed methods to handle dates, files, colours and ranges. We then extend the wire protocol, clearly defining how these are translated to user friendly values. And we spell "colour" with a "u" in the protocol if needs be. This also implies getters.I would prefer not to do this at all. It goes against what we have done with our API. I appreciate that we are manipulating the WebElement but it just feels wrong.
3) Add new wire protocol methods and add some role-based interfaces to WebElements, allowing users to cast them to whatever is appropriate. The wire protocol changes would be as with "2", with the addition that if we're returning a WebElement that represents an INPUT we also send the type attribute on the wire so we can bind the correct interfaces to the created WebElement instance.I have no real problem with this. The thing that I would like to avoid is overloading sendKeys or things like that since dynamically typed languages will have to do some nasty things that are not idiomatic! Having a role, with new JSONWireProtocol calls, is fine and we can then have things like setDate, or the idiomatic equivalent.
The potential issue that I can see is that users will think they are typing in the element, which is the reason why it was initially thought was against that. The roles might not be intuitive to users, as Jason said, but utility classes won't be as intuitive either but can be sorted by documentation.
4) We acknowledge that these new types are probably implemented using the Shadow DOM, and we make users delve into the Shadow DOM to interact with the elements.We should allow people, if they want to go into the weird and wonderful world of the Shadow DOM. Having these mechanisms will allow users to manipulate new input types that come out of the spec that we don't implement straight away. This will give us the forward thinking that we want for the API.
Speaking as the .NET bindings maintainer, I've come round to the opinion that explicit casting to the interface is not really idiomatic of recent-vintage .NET libraries. My personal opinion is that it looks tacky, but I don't know if that should enter into it.
I can't agree with that statement. I don't find role-based interfaces to be discoverable at all. Certainly not more so than utility classes. It's the path we've chosen, and it fits the pattern of the API thus far, so I won't raise a fuss if this is the direction we decide on.
Speaking as the .NET bindings maintainer, I've come round to the opinion that explicit casting to the interface is not really idiomatic of recent-vintage .NET libraries. My personal opinion is that it looks tacky, but I don't know if that should enter into it.