This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257171 - Misleading error message "Use BrwsrCtx.execute!"
Summary: Misleading error message "Use BrwsrCtx.execute!"
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Html4j (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-16 12:26 UTC by maxnitribitt
Modified: 2015-12-17 21:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
project for reproducing the bug (344.06 KB, application/zip)
2015-12-16 12:26 UTC, maxnitribitt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maxnitribitt 2015-12-16 12:26:01 UTC
Created attachment 157810 [details]
project for reproducing the bug

In the attached project, please test file "ExternalWebView". It causes an error with stacktrace:

java.lang.IllegalStateException: No presenter active. Use BrwsrCtx.execute!
	at com.dukescript.test.selenium.webdriver.DukeScriptBrowser.findElementById_impl(DukeScriptBrowser.java)
	at com.dukescript.test.selenium.webdriver.DukeScriptBrowser.findElementById(DukeScriptBrowser.java:156)
	at org.openqa.selenium.By$ById.findElement(By.java:218)
	at com.dukescript.test.selenium.webdriver.DukeScriptBrowser$3.run(DukeScriptBrowser.java:141)
	at net.java.html.BrwsrCtx$1Wrap.run(BrwsrCtx.java:177)
	at net.java.html.BrwsrCtx.execute(BrwsrCtx.java:186)

As you can see from StackTrace, it has been called from BrwsrCtx.execute.
Comment 1 Jaroslav Tulach 2015-12-17 20:32:43 UTC
Looks like this is real bug! Executor should be registered in BrwsrCtx, but it is not: you can workaround by building new context yourself and putting all the technologies there + the Executor.
Comment 2 Jaroslav Tulach 2015-12-17 21:24:54 UTC
http://hg.netbeans.org/html4j/rev/e390a06dbfac
Comment 3 Jaroslav Tulach 2015-12-17 21:31:26 UTC
The fix will be part of 1.3 version.

Here is fix of your code that works with current version 1.2.3:

--- a/src/test/java/com/dukescript/test/selenium/webdriver/ExternalWebView.java
+++ b/src/test/java/com/dukescript/test/selenium/webdriver/ExternalWebView.java
@@ -22,7 +22,6 @@
  * <http://www.gnu.org/licenses/gpl-3.0.html>.
  * #L%
  */
-import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -48,12 +47,17 @@
     @BeforeClass
     public static void test() throws InterruptedException, Exception {
         final CountDownLatch countDownLatch = new CountDownLatch(1);
-
+        final WebView[] arr = { null };
         final Runnable done = new Runnable() {
             @Override
             public void run() {
                 testModel = new TestModel("Hello", "World");
                 testModel.applyBindings();
+                try {
+                    driver = new WebDriverFX(arr[0]);
+                } catch (Exception ex) {
+                    Logger.getLogger(ExternalWebView.class.getName()).log(Level.SEVERE, null, ex);
+                }
                 countDownLatch.countDown();
             }
         };
@@ -63,11 +67,11 @@
                 try {
                     Stage stage = new Stage();
                     final WebView webView = new WebView();
+                    arr[0] = webView;
                     Scene scene = new Scene(webView);
                     stage.setScene(scene);
                     stage.show();
                     FXBrowsers.load(webView, ExternalWebView.class.getResource("testWithModel.html"), done);
-                    driver = new WebDriverFX(webView);
                 } catch (Exception ex) {
                     Logger.getLogger(ExternalWebView.class.getName()).log(Level.SEVERE, null, ex);
                 }