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.
Product Version: NetBeans IDE Dev (Build 1) Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25 Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25 System: Linux version 3.13.0-24-generic running on amd64; UTF-8; en_US (nb) Description: ============ If user wants his/her Selenium server to run on other than default (4444) port there is no way to configure that from within NetBeans IDE. The value is probably not passed correctly on command-line or not at all. Steps to reproduce: =================== 1. Download Selenium server [1]. [1] http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar 2. In "Services" view invoke "Configure" from popup menu of "Selenium Server" node. 3. Change "Port" to 4445. 4. "Browse..." to location of the downloaded JAR file and push "OK" button. 5. Invoke "Run" from popup menu of "Selenium Server" node. 6. In any web browser go to URL: http://localhost:4445/wd/hub Expected: Web Driver Hub introduction page opens. Actual: "Unable to connect" or similar page is displayed.
Some more investigation. If user configures the server via "Start" action, the non-default port number is accepted and used. However, if it is later stopped, port is changed and server is started again it does not work. The problem is that org.netbeans.modules.selenium2.server.Selenium2ServerSupport.initializeServer() method which sets the port is called only when the server is run for the first time. It is also supposed to be called on RELOAD action but this never happens due to Selenium2ServerSupport.propertyChanged(evt) not being ever called. It looks like Selenium2ServerSupport does not listen on org.netbeans.modules.selenium2.server.Selenium2Customizer's property changes. Hope this helps.
Created attachment 152845 [details] Proposal of code changes in Selenium2ServerSupport class fixing the ignored configuration changes. Selenium2ServerSupport is no longer PropertyChangeListener but registers itself as PreferenceChangeListener instead. If it is then notified about any preference change it checks whether Selenium server is running or not. In the former case it triggers RELOAD action or it only initializes the server in the latter case. Both actions set new configuration properly. Fanis, can I integrate the proposed changes or you want to improve the patch somehow and fix it yourself?
(In reply to Jiri Kovalsky from comment #2) > > Fanis, can I integrate the proposed changes or you want to improve the patch > somehow and fix it yourself? Jirko thank you for the investigation and patch. If you tested it and it works for you then please go ahead and push the fix.
Integrated into 'main-silver', will be available in build *201503270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/dcec4e6d0b43 User: Jiri Kovalsky <jkovalsky@netbeans.org> Log: Selenium2ServerSupport now listens on preference changes and on a such event either reconfigures and reloads the server if it was running or only reconfigures it in the other case. Task #251301 - "Port:" value is ignored in "Configure Selenium Server" dialog
Fixed in development build #201503270001.
Product Version: NetBeans IDE Dev (Build 201503270001) Java: 1.8.0_40; Java HotSpot(TM) 64-Bit Server VM 25.40-b25 Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25 System: Linux version 3.13.0-24-generic running on amd64; UTF-8; en_US (nb) Verified.