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 251301 - "Port:" value is ignored in "Configure Selenium Server" dialog
Summary: "Port:" value is ignored in "Configure Selenium Server" dialog
Status: VERIFIED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Selenium (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jiri Kovalsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-19 16:07 UTC by Jiri Kovalsky
Modified: 2015-03-27 11:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposal of code changes in Selenium2ServerSupport class fixing the ignored configuration changes. (2.81 KB, patch)
2015-03-25 21:06 UTC, Jiri Kovalsky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2015-03-19 16:07:40 UTC
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.
Comment 1 Jiri Kovalsky 2015-03-20 16:50:07 UTC
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.
Comment 2 Jiri Kovalsky 2015-03-25 21:06:04 UTC
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?
Comment 3 Theofanis Oikonomou 2015-03-26 11:21:44 UTC
(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.
Comment 4 Quality Engineering 2015-03-27 03:22:49 UTC
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
Comment 5 Jiri Kovalsky 2015-03-27 11:25:16 UTC
Fixed in development build #201503270001.
Comment 6 Jiri Kovalsky 2015-03-27 11:25:57 UTC
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.