jeudi 21 décembre 2017

how to click webbrowser element slowly

i created an app. it should paste status very quickly. clicking time is very quick and it redirects to other website very quickly. So i cannot even check it clicked the post button or not...

here i use code

        private void button3_Click(object sender, System.EventArgs e)
    {


        textBox4.Text = textBox3.Text;
        string[] groups = textBox4.Text.Split('\n');

        webBrowser1.Navigate("http://ift.tt/2Buvrye" + groups[0]);


        List<string> strings = new List<string>();


for(int i=1;i<groups.Length;i++)
{

    strings.Add("http://ift.tt/2Buvrye" + groups[i]);

    timer1.Interval = 20000;
    //timer1.Interval = Convert.ToInt32(textBox5.Text)*1000*60;



}
websites = strings.GetEnumerator();
            timer1.Enabled = true;


            websites.MoveNext();





    }
    private void timer1_Tick(object sender, EventArgs e)
    {
        webBrowser1.Navigate(websites.Current);
        webBrowser1.Document.GetElementById("u_0_0").SetAttribute("value", richTextBox2.Text);

        webBrowser1.Document.GetElementById("view_post").InvokeMember("click"); // <= this code is running very quickly







      timer1.Enabled = websites.MoveNext();




    }

I added clicking in timer1_Tick event. i want to wait 10 seconds after executing this.Because i want to check whether it clicked or not.(but it loading other website very quickly)

webBrowser1.Document.GetElementById("view_post").InvokeMember("click"); 

please help me to do it...




Aucun commentaire:

Enregistrer un commentaire