Jump to content

hey all

 

im trying to auto fill this page https://ess.emplivecloud.com/ useing the setattribute("value","string");

but the elements looks like this

 

<input name="_txtUsername" type="text" id="_txtUsername" style="width:150px;">

and

<input name="_txtPassword" type="password" id="_txtPassword" style="width:150px;">

 

but as you can see "value" isnt there,what do i do to fill the text boxes in this situation.

 

thanks in advance.

 

 

THE RIG 

CPU: i7 3770K @ 4.9 COOLER: Kraken X61 MOBO: Z77 Sabertooth RAM: Vengeance 16gb @1600 GPU: ASUS ROG Strix GTX 1080 PSU: EVGA Supernova G2 850w SSD: 850 Pro 256Gb    CASE: B/W phantom 410 AUDIO: Kraken 7.1 Chroma MOUSE: Death Adder Chroma KEYBOARD: Black Widow Chroma MONITOR: Triple 23" Apple Cinama Displays   VR: HTC Vive & Oculus Rift DK2 

Link to post
Share on other sites

 

3 minutes ago, dez4us said:

element.value = "string"

should suffice. 

'

i get this error" HTMLElement does not contain a definition for 'value' "

THE RIG 

CPU: i7 3770K @ 4.9 COOLER: Kraken X61 MOBO: Z77 Sabertooth RAM: Vengeance 16gb @1600 GPU: ASUS ROG Strix GTX 1080 PSU: EVGA Supernova G2 850w SSD: 850 Pro 256Gb    CASE: B/W phantom 410 AUDIO: Kraken 7.1 Chroma MOUSE: Death Adder Chroma KEYBOARD: Black Widow Chroma MONITOR: Triple 23" Apple Cinama Displays   VR: HTC Vive & Oculus Rift DK2 

Link to post
Share on other sites

What browser are you trying this in? Also, I'm assuming your element is defined like so: 

 

let element = document.getElementById("_txtUsername")

or similar. It should technically report it as an HTMLInputElement and not HTMLElement.

Link to post
Share on other sites

1 minute ago, dez4us said:

What browser are you trying this in? Also, I'm assuming your element is defined like so: 

 


let element = document.getElementById("_txtUsername")

or similar. It should technically report it as an HTMLInputElement and not HTMLElement.

        HtmlDocument doc;
        HtmlElement username;
        HtmlElement password;
        HtmlElement username1;
        HtmlElement password1;

and once the page has loaded and this function has been called

 

                Console.WriteLine("attempting to find tag id");
                var U = users.FirstOrDefault(User => User.TagId == tag.ToString());
              

                try
                {
                    username.SetAttribute("value", "00" +Decrypt(U.UserId) + "@dahlsens");
                    password.SetAttribute("value", Decrypt(U.Pword));


                   
                    
                    username1.SetAttribute(" ","works!");// "00" + Decrypt(U.UserId) + "@dahlsens");
                    password1.SetAttribute("value","password");// Decrypt(U.Pword));

                    //  sim.Keyboard.KeyPress(VirtualKeyCode.RETURN);
                }
                catch { }
            }

im using the webbrowser in visual studio

THE RIG 

CPU: i7 3770K @ 4.9 COOLER: Kraken X61 MOBO: Z77 Sabertooth RAM: Vengeance 16gb @1600 GPU: ASUS ROG Strix GTX 1080 PSU: EVGA Supernova G2 850w SSD: 850 Pro 256Gb    CASE: B/W phantom 410 AUDIO: Kraken 7.1 Chroma MOUSE: Death Adder Chroma KEYBOARD: Black Widow Chroma MONITOR: Triple 23" Apple Cinama Displays   VR: HTC Vive & Oculus Rift DK2 

Link to post
Share on other sites

  private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {

         
           

                try
                {
                    doc = webBrowser1.Document;
                    username = doc.GetElementById("Username");
                    password = doc.GetElementById("Password");

               
                    username1 = doc.GetElementById("_txtUsername");
                    password1 = doc.GetElementById("_txtPassword");



            }

theres this aswell

THE RIG 

CPU: i7 3770K @ 4.9 COOLER: Kraken X61 MOBO: Z77 Sabertooth RAM: Vengeance 16gb @1600 GPU: ASUS ROG Strix GTX 1080 PSU: EVGA Supernova G2 850w SSD: 850 Pro 256Gb    CASE: B/W phantom 410 AUDIO: Kraken 7.1 Chroma MOUSE: Death Adder Chroma KEYBOARD: Black Widow Chroma MONITOR: Triple 23" Apple Cinama Displays   VR: HTC Vive & Oculus Rift DK2 

Link to post
Share on other sites

this is for 2 web forms the first works perfecty the second doesnt

THE RIG 

CPU: i7 3770K @ 4.9 COOLER: Kraken X61 MOBO: Z77 Sabertooth RAM: Vengeance 16gb @1600 GPU: ASUS ROG Strix GTX 1080 PSU: EVGA Supernova G2 850w SSD: 850 Pro 256Gb    CASE: B/W phantom 410 AUDIO: Kraken 7.1 Chroma MOUSE: Death Adder Chroma KEYBOARD: Black Widow Chroma MONITOR: Triple 23" Apple Cinama Displays   VR: HTC Vive & Oculus Rift DK2 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×