private void TestRunJsSynchronouslyToolStripMenuItemClick(object sender, EventArgs e) { Random rand = new Random(); int a = rand.Next(1, 10); int b = rand.Next(1, 10); try { String result = _browserControl.RunScript(a + "+" + b, "RunJsTest", 1, 5000); if (result == (a + b).ToString()) { MessageBox.Show(string.Format("{0} + {1} = {2}", a, b, result), "Success"); } else { MessageBox.Show(string.Format("{0} + {1} != {2}", a, b, result), "Failure"); } } catch (Exception err) { MessageBox.Show(err.ToString(), "Failure"); } }