lefthandedgoat / canopy

f# web automation and testing library, built on top of Selenium (friendly to c# also)
http://lefthandedgoat.github.io/canopy/
MIT License
507 stars 115 forks source link

Is there a way append text to an input textbox? #392

Closed rodsantest1 closed 6 years ago

rodsantest1 commented 6 years ago

Is there a way append text to an input textbox?

For example, when I'm editing a record, can I take a textbox by its xpath and append to its existing value and re-save the record?

I tried this: "/html/body/form/table/tbody/tr[2]/td[2]/input" << "edited" + sprintf "%s" "/html/body/form/table/tbody/tr[2]/td[2]/input"

lefthandedgoat commented 6 years ago

You can turn on this configuration optimizeByDisablingClearBeforeWrite but that would change the behaviour for everything.

You could also do

"/html/body/form/table/tbody/tr[2]/td[2]/input" << ((read "/html/body/form/table/tbody/tr[2]/td[2]/input") + "edited")