Sorry for the noob question, I am teaching myself c#.
I want to be able to call a class into a form but it requires some form of parameter and I am not sure what it means.
public partial class AtpTester2 : Form
{
TestLauncher tLaunch = new TestLauncher();
OpenFileDialog openFileDialog = new OpenFileDialog();
string browser;
public AtpTester2()
{
InitializeComponent();
}
private void UrlFilePickerBtn_Click(object sender, EventArgs e)
{
var fileContent = string.Empty;
var filePath = string.Empty;
openFileDialog.InitialDirectory = Application.StartupPath;
openFileDialog.Filter = "txt files (*.txt)|*.txt|All Files (*.*)|*.*";
openFileDialog.FilterIndex = 2;
openFileDialog.RestoreDirectory = true;
if(openFileDialog.ShowDialog() == DialogResult.OK)
{
filePath = openFileDialog.FileName;
var fileStream = openFileDialog.OpenFile();
StreamReader reader = new StreamReader(fileStream);
fileContent = reader.ReadToEnd();
}
MessageBox.Show(fileContent, "URLs to test:", MessageBoxButtons.OK);
tLaunch.OpenBrowser();
}
}
This is the error message I am getting:
CS7036 There is no argument given that corresponds to the required formal parameter 'browserType' of 'TestLauncher.TestLauncher(string)' AtpSelenium C:\Coding\ATP\AtpSelenium2\AtpSelenium\AtpTester2.cs
I have tried adding browserType into the = new TestLauncher() section but it still gives an error.