Page 1 of 1
SetAttributeValue and Web
Posted: Wed Sep 02, 2015 2:07 pm
by Uwes
Hello,
I've been trying to work with items on a website, i.e. using
Code: Select all
mytextbox.Element.SetAttributeValue("Text", "123");
Things that work in winforms don't work in the web.
Why?
Re: SetAttributeValue and Web
Posted: Wed Sep 02, 2015 2:16 pm
by odklizec
Hi,
It works for me in my web-based tests. What kind of element is this "mytextbox" (HTML Input tag or something else)? Could you please post Ranorex snapshot of the element in question?
Re: SetAttributeValue and Web
Posted: Wed Sep 02, 2015 4:30 pm
by Uwes
Seems to fail with any "text box" - like thing
including
https://de.wikipedia.org./wiki/Wikipedia:Hauptseite -> the "Search/Suchen" textbox top right. Seems to be a "input" html tag.
also the "pattern" textbox on
http://derekslager.com/blog/posts/2007/ ... ester.ashx
which is a textarea.
So
does not abstract all that mess out?
Got a quick sample code on how to add text to those two textthingies because I'm a bit stuck.
Thanks
Re: SetAttributeValue and Web
Posted: Wed Sep 02, 2015 4:42 pm
by odklizec
OK, I missed there is used "Text" in your sample. You will have to use InnerText or better TagValue for the web-based inputs.