Пример #1
0
        public void TestFieldAccessInOpera()
        {
            //_GenericFieldAssertions(Browsers.Opera.String);

            using (IJavaSelenium javaSelenium = _GetJavaSelenium(Browsers.Opera.String, FIELD_ACCESS_OBJECT_ID))
            {
                javaSelenium.Selenium.Start();
                javaSelenium.Selenium.Open(URL);

                Assert.AreEqual("5", javaSelenium.GetField("intField"));
                javaSelenium.SetField("intField", 6);
                Assert.AreEqual("6", javaSelenium.GetField("intField"));

                // BUG: It seems that return values that are strings are affected
                //Assert.AreEqual("Hello", javaSelenium.GetField("stringField"));
                //javaSelenium.SetField("stringField", "Goodbye");
                //Assert.AreEqual("Goodbye", javaSelenium.GetField("stringField"));

                Assert.AreEqual("6", javaSelenium.GetField("otherField.intField"));
                javaSelenium.SetField("otherField.intField", 7);
                Assert.AreEqual("7", javaSelenium.GetField("otherField.intField"));

                // BUG: It seems that return values that are strings are affected
                //Assert.AreEqual("Testing", javaSelenium.GetField("otherField.stringField"));
                //javaSelenium.SetField("otherField.stringField", "1, 2, 3");
                //Assert.AreEqual("1, 2, 3", javaSelenium.GetField("otherField.stringField"));
            }
        }
Пример #2
0
        private static void _GenericPackageAssertions(string pBrowser)
        {
            using (IJavaSelenium javaSelenium = _GetJavaSelenium(pBrowser, PACKAGE_ACCESS_OBJECT_ID))
            {
                javaSelenium.Selenium.Open(URL);

                Assert.AreEqual("5", javaSelenium.GetField("Packages.com.mycompany.MyClass.staticField"));
                javaSelenium.SetField("Packages.com.mycompany.MyClass.staticField", 6);
                Assert.AreEqual("6", javaSelenium.GetField("Packages.com.mycompany.MyClass.staticField"));

                javaSelenium.InvokeMethod("Packages.com.mycompany.MyClass.staticMethod");
            }
        }