문제

There is a small webpage with 2 text boxes and 2 buttons each to submit data in each textbox to the server. I have a list of values in a notepad which i want to submit through the second textbox automatically.

I believe it will work something like... copies the first line and paste it in the second box and press submit.. once done repeats the process for all lines in the notepad...

I have been trying to develop a windows application using c# but to no avail this far.

All i want is to automate this process... and looking forward for HELP !!!!!!

도움이 되었습니까?

해결책

Never mind.. did it through WatiN :)

after adding a reference to the project.. i used the mentioned code

    private void btnComplete_Click(object sender, EventArgs e)
    {
        try
        {
            lblStatus.Text = "";    
            string[] Orders = txtOrders.Text.Split('\n');

                foreach (string text in Orders)
                {
                    // locate the Order Number (Completer) 
                    browser.TextField(Find.ByName("txt_comp_order")).Value = text;

                    browser.Button(Find.ByName("Button2")).Click();

                }

                lblStatus.Text = Orders.Length.ToString() + " Order(s) COMPLETED";

        }

        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top