So I am trying to read a site with C#. I have it so it opens a website and goes to read a TextField. However the website has the text field like so.
<input name="loginMail" class="c-txtfld c-txtfld-fixed c-txtfld-green c-txtfld-medium" id="login-email" type="email" placeholder="Email address" pattern="[^ @]*@[^ @]*">
And because of this I can get C# to read it.
TextField emailaddressfield = this.Document.TextField(Find.BySelector("form#login-form.credential-form input#login-email")
It will work however if I edit the type
attribute to text
.
I want to keep this as email
. How can I read it like that?
It is possible to create a custom control from existing WatiN controls (HTML). In order to get text field value of type
email
, we need to create a custom control which would be of type TextField. Please try below code.(Pseudo code - not complied)