some thoughts...
modify the DOM via javascript to remove those attributes or change the
value of those attributes. then continue with typing into the field
not sure if that's possible though.
fake user agent of browser, unfortunately, I believe you can't do that
with SafariDriver so that won't help. But for fun/testing, you could
try faking user agent of Firefox to pretend to be Safari (I think that
was editing profile settings, etc. for user agent parameter), and see
if the attributes show up. I'm guessing the site you are testing,
checks against Safari and renders differently or such.
On Aug 13, 10:47 am, Pavithra Navaneeth <
pavi...@gmail.com> wrote:
> Jason,
> Thanks for the info!!
> Is there any alternative to type in such fields?
>
> Note: In other browsers, I am not seeing this attributes:
> contenteditable="true"
> unselectable="off"
> It appears only in safari browser while inspecting. Any reason?
>
> --Pavithra
>
>
>
>
>
>
>
>
>
> On Mon, Aug 13, 2012 at 11:13 PM, Jason Leyba <
jmle...@gmail.com> wrote:
> > The SafariDriver does not support typing in contentEditable fields.
>
> > -- Jason
>
> > On Monday, August 13, 2012 12:27:22 AM UTC-7, Pavithra wrote:
>
> >> Sorry missed to close the head tag before body tag.
> >> Dom Structure is like this:
> >> <html>
> >> <head></head>
> >> <body></body>
> >> </html>
>
> >> On Monday, August 13, 2012 12:55:17 PM UTC+5:30, Pavithra wrote:
>
> >>> Just started using Safari Driver as perhttp://
code.google.com/p/**
> >>> selenium/wiki/SafariDriver<
http://code.google.com/p/selenium/wiki/SafariDriver>
> >>> Launched Safari using below code:
> >>> capability = DesiredCapabilities.safari();
> >>> driver = new RemoteWebDriver(new URL("http://" + serverIp + ":" +
> >>> serverPort + "/wd/hub"), capability);
> >>> return driver;
>
> >>> org.openqa.selenium.**WebDriverException: Cannot set the selection end
> >>> error is thrown when I am trying to type on the element inside iframe.
> >>> I switched to iframe using switchto frame (based on frame name).
>
> >>> Below is the element xpath inside iframe (from safari browser):
> >>> <html>
> >>> <head>
> >>> <style></style>
> >>> <body style="padding-top: 15px; padding-right: 15px; padding-bottom:
> >>> 15px; padding-left: 15px; font-size: 13px; font-family: Arial, Helvetica,
> >>> sans-serif; color: black; " contenteditable="true"
> >>> unselectable="off"></body>
> >>> </html>
>
> >>> element is identified as xpath,/html/body
>
> >>> While trying to type on the above element it throws the error:
> >>> org.openqa.selenium.**WebDriverException: Cannot set the selection end