[Owasp-o2-platform] How to set a text value into an html element?

Fabricio Braz fabricio.braz at gmail.com
Mon May 21 12:35:02 UTC 2012

Hi there,

I was trying to test a log in page, but O2 has not recognized the form
field "login_email".

Just to make it clear, here are the steps I've done:

- After loading the target page I run the following command:

return ie.fields();

- The page shows two fields (user login_email and password_login),
even though the O2 Output shows only the password_login field.

- I started to look into the page elements ie.elements() and I found
the missed field. Here is an extract of it:

     HTMLElement: System.__ComObject
     Images: WatiN.Core.ImageCollection
     InnerHtml: <INPUT style="WIDTH: 200px; HEIGHT: 26px"
id=login_email name=email type=email>
     OuterHtml: <DIV class=input><INPUT style="WIDTH: 200px; HEIGHT:
26px" id=login_email name=email type=email> </DIV>

- Since the element was identified, I thought that I could use the
setText to supply the user name I wanted to log in.

     ie.elements()[28].set_Text("fabricio.braz at gmail.com");

When I got the following error:

     44::1::CS0311::The type 'WatiN.Core.Element' cannot be used as
type parameter 'T' in the generic type or method
string)'. There is no implicit reference conversion from
'WatiN.Core.Element' to

Considering the scenario above, could you help me set a text value
into the login_email field?

Thanks in advance,

Fabricio Braz

More information about the Owasp-o2-platform mailing list