Search code examples
c#autocompletesiebel

Autopopulate textboxes in Sieble CRM system, trough webBrowser1 in c#


Do any have any experience how this cold be done, if you look at the image im looking for a solution to programacly change the Name field to somehing else stored inn a variable from a other textbox.

i was thinking of using something like

    private void button1_Click(object sender, EventArgs e)
    {
      var xBox = textbox1.value;

      webBrowser1.Document.All.GetElementsByName("Name")[0].SetAttribute("Value", xBox);
    }

but i dont know the name of the Textbox, and Sieble seems to be a java thing? so i cant see the source behind it? does anyone know how to solve this issue. im making a automate app to help at work for handeling over 100 cases a day. Instead of typing the names, im looking for a solution to populate by the click of a button.

I cant handel this by the sieble API because we dont have contorle of the Siebel develompent, and wold take years to get the Sieble department to implement somthing like this in to the GUI. so im making a desktop app that can handel the issue.

alt text


Solution

  • My solution to this was using cordinates, and simulate keys klicks, im using Global Mouse and Keyboard Library for this, found at this location http://www.codeproject.com/KB/system/globalmousekeyboardlib.aspx

    private void button1_Click(object sender, EventArgs e)
        {
            this.Location = new Point(0, 0);
    
            inputBlocker();
            xX = int.Parse(this.Location.X.ToString());
            yY = int.Parse(this.Location.Y.ToString());
            defaultMousePos();
            //Thread.Sleep(600);
    
           Cursor.Position = new Point(Cursor.Position.X + 1185, Cursor.Position.Y + 254);
           //Thread.Sleep(600);
           MouseSimulator.DoubleClick(MouseButton.Left);
           KeyboardSimulator.KeyPress(Keys.T);
           KeyboardSimulator.KeyPress(Keys.E);
           KeyboardSimulator.KeyPress(Keys.S);
           KeyboardSimulator.KeyPress(Keys.T);
           KeyboardSimulator.KeyPress(Keys.O);
           KeyboardSimulator.KeyPress(Keys.K);
           KeyboardSimulator.KeyPress(Keys.Enter);
    
    
    
           needUnblock = true;
           inputBlocker();
    
        }