It's because it's not implemented. Try breaking out the underlying
webdriver instance:
WebDriver driver = ((WrapsDriver) selenium).getWrappedDriver();
WebElement element = driver.findElement(By.id("DATETO_0"));
element.sendKeys(Keys.HOME);
Simon
On Tue, May 15, 2012 at 5:11 PM, robocop <richar...@gmail.com> wrote:
> Hi
>
> Is there any reason why setCursorPosition not working in webdriver backed
> selenium . the code is
>
> selenium.setCursorPosition("id=DATETO_0", "0");
>
> and the source code of text box is below
>
> <input type="TEXT" onblur="TidyDate(" datefrom_0")"="" onfocus="CellFocus("
> value=" / / " tabindex="0" maxlength="10" size="12" id="DATEFROM_0"
> name="DATEFROM_0" class="INPUT">
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Selenium Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/selenium-users/-/Hkgwd5BJKhMJ.
> To post to this group, send email to selenium-users@googlegroups.com.
> To unsubscribe from this group, send email to
> selenium-users+unsubscribe@googlegroups.com.
What happens if we want to set the cursor position as we are doing in RC
selenium.type("id=myid","mypage");
selenium.setCursorPosition("id=myid",2);
selenium.type("id=myid","prank");
sothat the text in that box becomes myprankpage.How to implement this in webdriver...
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/DTC4z2A0f_QJ.
For more options, visit https://groups.google.com/groups/opt_out.
Actions performAction = new Actions(driver);
WebElement myID = driver.findElement(By.id("myid"));---finding the elementmyID.sendKeys("mypage"); ----typing "mypage"
performAction.moveToElement(myID).perform(); ---again moving to the same element
myID.sendKeys("prank"); ---typing "prank"
In this case we are not really moving the cursor position to 2nd. is not it