I am trying to fill a website form using C#Desktop application.
I am using the following form as an example -
Is there anyway I can send these values using URL Parameters? I am confused how I can find the parameter name of each field. I have to generate multiple URLs and store them in a file so that the end user can click on them later.
Please guide. Thank you.
I am using the following form as an example -
Web Form Example
These sample HTML forms show how easy it can be to build forms with FormSmarts form creator.
formsmarts.com
C#:
private void button1_Click(object sender, EventArgs e)
{
// Initialize Chrome WebDriver
IWebDriver driver = new ChromeDriver();
// Navigate to the form URL
driver.Navigate().GoToUrl("https://formsmarts.com/html-form-example");
var frame = driver.FindElement(By.CssSelector("iframe.fs_embed"));
driver.SwitchTo().Frame(frame);
driver.FindElement(By.CssSelector("input[placeholder='Your first name']")).SendKeys("John");
driver.FindElement(By.CssSelector("input[placeholder='Your last name']")).SendKeys("Doe");
//more code
}
Is there anyway I can send these values using URL Parameters? I am confused how I can find the parameter name of each field. I have to generate multiple URLs and store them in a file so that the end user can click on them later.
Please guide. Thank you.
Last edited: