java.net.ConnectException: Connection refused: connect

Getting Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:4444 [/127.0.0.1] failed: Connection refused: connect exception when I run it from RPA studio.

Code:
<?xml version="1.0" encoding="UTF-8"?>

<![CDATA[
import com.thoughtworks.selenium.;
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium;
import org.openqa.selenium.
;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.interactions.Actions;
import java.util.concurrent.TimeUnit;
import com.google.gson.Gson;

                            String url = "http://beta.speedtest.net/";
            
                           String userName = "wf-robot@mail.com";
                            
                            String password = "freedom4ROBOTS";
                            
                            List productList = new ArrayList();

            ]]></script>
            <selenium-flow>
                            <selenium name="seleniumDriver" browser="internet explorer" close-on-completion="true" start-in-private="true">
                                            <script><![CDATA[
                                                            seleniumDriverObj = seleniumDriver.getWrappedObject();
                                                            seleniumDriverObj.manage().timeouts().implicitlyWait(2, TimeUnit.MINUTES).pageLoadTimeout(2, TimeUnit.MINUTES);
                                                            seleniumDriverObj.get(url);
                                                            seleniumDriverObj.findElement(By.id("email")).sendKeys(new String[]{userName});
                                                            seleniumDriverObj.findElement(By.id("password")).sendKeys(new String[]{password});
                                                            seleniumDriverObj.findElement(By.xpath("//input[@name='btn_login']")).click();
                                                            seleniumDriverObj.findElement(By.xpath("//span[text() = 'Products']")).click();
                                                            Thread.sleep(3000);
                                                            seleniumDriverObj.findElement(By.xpath("//li//a[text() = 'View products']")).click();
                                                            Thread.sleep(3000);
                                                            List productTableRows = seleniumDriverObj.findElements(By.xpath("//div[@id='main-area']//div[@id='content']/div/table/tbody/tr"));
                                                            for (int i = 0; i < 15; i++) {
                                                                            WebElement productRow = (WebElement) productTableRows.get(i);
                                                                            Map product = new LinkedHashMap();
                                                                            product.put("Family", productRow.findElement(By.xpath("td[1]")).getText());
                                                                            product.put("SKU", productRow.findElement(By.xpath("td[2]")).getText());
                                                                            product.put("ProductName", productRow.findElement(By.xpath("td[3]")).getText());
                                                                            product.put("ProductDescription", productRow.findElement(By.xpath("td[4]")).getText());
                                                                            product.put("Price", productRow.findElement(By.xpath("td[5]")).getText());
                                                                            productList.add(product);
                                                            }
                                            ]]></script>
                            </selenium>
            </selenium-flow>
            <var-def name="productDataString">
                            <script return="productData"><![CDATA[
                                            Gson gson = new Gson();
                                            String productData = gson.toJson(productList);
                            ]]></script>
            </var-def>
            <var-def name="outputFilePath">
                            <script return="outputFile">
                                            <![CDATA[
                                                            outputFile = "D:/WH/";
                                            ]]>
                            </script>
            </var-def>
            <file path="${outputFilePath}/product-table-data.csv" action="write" type="binary">
                            <list-to-csv separator="|">
                  <var name="productDataString"/>
                </list-to-csv>
            </file>
            <export include-original-data="true">
            <multi-column list="${productList}" split-results="true">
           <put-to-column-getter name="Family" property="Family" />
           <put-to-column-getter name="SKU" property="SKU" />
           <put-to-column-getter name="ProductName" property="ProductName" />
           <put-to-column-getter name="ProductDescription" property="ProductDescription" />
           <put-to-column-getter name="Price" property="Price" />
                            </multi-column>
            </export>

Exception:

                   18:50:42.502 INFO  [main] c.f.c.w.p.selenium.RoboticsFlowPlugin.initPluginVariables[:123] - Select robot location : RobotLocation{SeleniumServerLocation{protocol='http', host='127.0.0.1', port=4444, context='null', file='/wd/hub'}, username='', password=''
      18:50:42.538 INFO  [main] c.f.c.w.plugin.selenium.CapabilityHelper.buildIdentification[:64] - Identification Capability: {host.name=local, context.path=local, run.name=null, run.uuid=C5539655-5C5C-4BB8-9BC4-799B8F3F224D, run.author.fullname=null, run.author.email=null, task.name=WWI TODO: Config name should be here}
  18:50:42.712 INFO  [main] c.f.c.webharvest.selenium.RobotLocation.getURL[:38] - URL : http://127.0.0.1:4444/wd/hub with userInfo : null
 18:50:44.131 INFO  [main] c.f.c.w.p.selenium.RoboticsFlowPlugin.closeDrivers[:154] - Drivers count to close: 0
 18:50:44.139 ERROR [main] c.w.s.r.w.w.l.WebHarvestMainLauncher.main[:143] - RoboticsFlowPlugin executePlugin nodeId 'null' exception: 
 org.webharvest.exception.PluginException: RoboticsFlowPlugin executePlugin nodeId 'null' exception:  com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:106) ~[workfusion-machine.jar:na]
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumFlowPlugin.executePlugin(SeleniumFlowPlugin.java:38) ~[workfusion-machine.jar:na]
at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125) ~[workfusion-webharvest-core.jar:na]
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127) ~[workfusion-webharvest-core.jar:na]
at org.webharvest.runtime.Scraper.execute(Scraper.java:169) ~[workfusion-webharvest-core.jar:na]
at org.webharvest.runtime.Scraper.execute(Scraper.java:182) ~[workfusion-webharvest-core.jar:na]
at com.workfusion.studio.rpa.wf.webharvest.launch.StudioWebHarvestTaskExecutor.execute(StudioWebHarvestTaskExecutor.java:108) ~[com.workfusion.studio.wf_8.4.0.jar:na]
at com.workfusion.studio.rpa.wf.webharvest.launch.SingleThreadWebHarvestProcess.processTaskInputs(SingleThreadWebHarvestProcess.java:75) ~[com.workfusion.studio.wf_8.4.0.jar:na]
at com.workfusion.studio.rpa.wf.webharvest.launch.SingleThreadWebHarvestProcess.start(SingleThreadWebHarvestProcess.java:44) ~[com.workfusion.studio.wf_8.4.0.jar:na]
at com.workfusion.studio.rpa.wf.webharvest.launch.WebHarvestMainLauncher.launch(WebHarvestMainLauncher.java:83) ~[com.workfusion.studio.wf_8.4.0.jar:na]
at com.workfusion.studio.rpa.wf.webharvest.launch.WebHarvestMainLauncher.main(WebHarvestMainLauncher.java:141) ~[com.workfusion.studio.wf_8.4.0.jar:na]
   Caused by: java.lang.RuntimeException: Connect to 127.0.0.1:4444 [/127.0.0.1] failed: Connection refused: connect at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.execute(SeleniumClient.java:128) ~[rpa-api.jar:na]
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.findAndLockNode(SeleniumClient.java:109) ~[rpa-api.jar:na]
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:94) ~[workfusion-machine.jar:na]
... 10 common frames omitted
  Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:4444 [/127.0.0.1] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107) ~[httpclient.jar:4.5.1]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) ~[httpclient.jar:4.5.1]
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.execute(SeleniumClient.java:125) ~[rpa-api.jar:na]
... 12 common frames omitted
    Caused by: java.net.ConnectException: Connection refused: connect
  at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[na:1.8.0_141]
   at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) ~[na:1.8.0_141]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_141]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_141]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_141]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) ~[na:1.8.0_141]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_141]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_141]
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) ~[httpclient.jar:4.5.1]
at  org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134) ~[httpclient.jar:4.5.1]
... 23 common frames omitted

@bharathi.senthilnathan

Hi Bharathi,
Does the error occur in RPA Express or WorkFusion SPA?

I am facing the same issue. I am using RPA Express

@bharathi.senthilnathan @jdhar
Are you using scripts created in WorkFusion SPA? In this case you’ll have to change the settings for RPA Express:
hub - port 15444
node - port 15410
Please let me know if it doesn’t work.

I am using WF Studio to run the web boot. I downloade WF studio from - this seems to be part SPA on knowledge base, so i believe it’s for SPA.

https://kb.workfusion.com/display/WF/Installation+and+Update

Please help

Here’s the full exception - not sure why it is trying to connect to
Connecting to localhost/127.0.0.1:4444 as showing below. I am copying the code below.

11:24:22 [DEBUG] CookieSpec selected: default
11:24:22 [DEBUG] Auth cache not set in the context
11:24:22 [DEBUG] Connection request: [route: {}->http://localhost:4444][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
11:24:22 [DEBUG] Connection leased: [id: 0][route: {}->http://localhost:4444][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
11:24:22 [DEBUG] Opening connection {}->http://localhost:4444
11:24:22 [DEBUG] Connecting to localhost/127.0.0.1:4444
11:24:23 [DEBUG] Connect to localhost/127.0.0.1:4444 timed out. Connection will be retried using another IP address
11:24:23 [DEBUG] Connecting to localhost/0:0:0:0:0:0:0:1:4444
11:24:24 [DEBUG] http-outgoing-0: Shutdown connection
11:24:24 [DEBUG] Connection discarded
11:24:24 [DEBUG] Connection released: [id: 0][route: {}->http://localhost:4444][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
11:24:24 [WARN] [urn:uuid:C8137C7BDE170D4F7715145646615103] selenium-flow plugin execution exception : Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
java.lang.RuntimeException: Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.execute(SeleniumClient.java:128)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.findAndLockNode(SeleniumClient.java:109)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:101)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumFlowPlugin.executePlugin(SeleniumFlowPlugin.java:38)
at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
at org.webharvest.runtime.Scraper.execute(Scraper.java:169)
at org.webharvest.runtime.Scraper.execute(Scraper.java:182)
at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:182)
at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.processTaskInputs(SingleThreadWebHarvestProcess.java:77)
at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.start(SingleThreadWebHarvestProcess.java:46)
at com.workfusion.studio.launch.WebHarvestMainLauncher.launch(WebHarvestMainLauncher.java:79)
at com.workfusion.studio.launch.WebHarvestMainLauncher.main(WebHarvestMainLauncher.java:121)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.execute(SeleniumClient.java:125)
… 12 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
… 23 more
11:24:24 [INFO] [urn:uuid:C8137C7BDE170D4F7715145646615103] Drivers count to close: 0
11:24:24 [INFO] [urn:uuid:C8137C7BDE170D4F7715145646615103] -= selenium-flow plugin execute finished
11:24:24 [ERROR] [urn:uuid:C8137C7BDE170D4F7715145646615103] selenium-flow executePlugin exception: [nodeId=null] Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
org.webharvest.exception.PluginException: [urn:uuid:C8137C7BDE170D4F7715145646615103] selenium-flow executePlugin exception: [nodeId=null] Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:116)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumFlowPlugin.executePlugin(SeleniumFlowPlugin.java:38)
at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
at org.webharvest.runtime.Scraper.execute(Scraper.java:169)
at org.webharvest.runtime.Scraper.execute(Scraper.java:182)
at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:182)
at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.processTaskInputs(SingleThreadWebHarvestProcess.java:77)
at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.start(SingleThreadWebHarvestProcess.java:46)
at com.workfusion.studio.launch.WebHarvestMainLauncher.launch(WebHarvestMainLauncher.java:79)
at com.workfusion.studio.launch.WebHarvestMainLauncher.main(WebHarvestMainLauncher.java:121)
Caused by: java.lang.RuntimeException: Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.execute(SeleniumClient.java:128)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.findAndLockNode(SeleniumClient.java:109)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.RoboticsFlowPlugin.executePlugin(RoboticsFlowPlugin.java:101)
… 10 more
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:4444 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at com.freedomoss.crowdcontrol.webharvest.plugin.selenium.SeleniumClient.execute(SeleniumClient.java:125)
… 12 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
… 23 more
11:24:24 [INFO] -------------------------------------------
11:24:24 [INFO] EXECUTION FAILED
11:24:24 [INFO] -------------------------------------------

Here’s the code -

<?xml version="1.0" encoding="UTF-8"?> <![CDATA[ import java.util.concurrent.ConcurrentSkipListMap.KeySet; import java.util.concurrent.TimeUnit; import org.openqa.selenium.support.ui.Select; // make list with map with item to the invoice for test items = [ ["item": "product 1", "quantity" : "2", "price" : "25", "discount" : "5", "description" : "some test product 1"], ["item": "product 2", "quantity" : "1", "price" : "50", "discount" : "0", "description" : "some test product 2"] ]; // get web driver and set his setups ieDriver = seleniumDriver.getWrappedObject(); ieDriver.manage().timeouts().implicitlyWait(2, TimeUnit.MINUTES).pageLoadTimeout(1, TimeUnit.MINUTES); // get invoice plane page ieDriver.get("https://invoiceplane.workfusion.com"); element_present = ieDriver.getPageSource().contains("btn btn-block btn-primary"); // if it need login to the invoiceplane if(element_present) { // set login name userNameTextBox = ieDriver.findElement(By.id("email")); userNameTextBox.click(); userNameTextBox.sendKeys("wf-robot@mail.com"); // set login password passWordTextBox =ieDriver.findElement(By.id("password")); passWordTextBox.click(); passWordTextBox.sendKeys("freedom4ROBOTS"); // click login button logInButton =ieDriver.findElement(By.name("btn_login")); logInButton.click(); } // click 'invoices' in the parent main menu ieDriver.findElement(By.xpath("//div/div/ul[1]/li[4]/a")).click(); // click 'Create invoce' in the child menu ieDriver.findElement(By.linkText("Create Invoice")).click(); // select 'Client' by text value from list selectClient = new Select(ieDriver.findElement(By.xpath("//select[@id='client_name']"))); selectClient.selectByVisibleText("SR Infotech"); // set 'invoice' date elementDate = ieDriver.findElement(By.id("invoice_date_created")); elementDate.click(); elementDate.clear(); //clear old date for correct entered elementDate.sendKeys("10/02/2017"); elementDate.sendKeys(Keys.ENTER); // select 'Invoice group' by text value from list selectIG = new Select(ieDriver.findElement(By.xpath("//select[@id='invoice_group_id']"))); selectIG.selectByVisibleText("Invoice Default"); // press 'Submit' to the create invoice submitButton = ieDriver.findElement(By.id("invoice_create_confirm")); submitButton.click(); // filling items tabl in the invoice apacheSU = org.apache.commons.lang3.StringUtils; //---------- def addItems = 0; def itemsSize = items.size(); //---------- items.each { // calc add item addItems++; // get item row values item = apacheSU.isBlank(it.get("item")) ? "N/A" : it.get("item"); quantity = apacheSU.isBlank(it.get("quantity")) ? "0" : it.get("quantity"); price = apacheSU.isBlank(it.get("price")) ? "0" : it.get("price"); discount = apacheSU.isBlank(it.get("discount")) ? "0" : it.get("discount"); description = apacheSU.isBlank(it.get("description")) ? "No description" : it.get("description"); // set item row value in invoice ieDriver.findElement(By.xpath("//*[@id='item_table']/tbody[last()]/tr[1]//input[@name='item_name']")).sendKeys(item); ieDriver.findElement(By.xpath("//*[@id='item_table']/tbody[last()]/tr[1]//input[@name='item_quantity']")).sendKeys(quantity); ieDriver.findElement(By.xpath("//*[@id='item_table']/tbody[last()]/tr[1]//input[@name='item_price']")).sendKeys(price); ieDriver.findElement(By.xpath("//*[@id='item_table']/tbody[last()]/tr[1]//input[@name='item_discount_amount']")).sendKeys(discount); ieDriver.findElement(By.xpath("//*[@id='item_table']/tbody[last()]/tr[2]/td[1]/div/textarea[@name='item_description']")).sendKeys(description); // if not all item in invoice add new item row if(addItems<itemsSize) { ieDriver.findElement(By.cssSelector(".btn_add_row")).click(); } } // set discount for full invoice items ieDriver.findElement(By.xpath("//input[@id='invoice_discount_percent']")).sendKeys("5"); // set 'Invoice Terms' ieDriver.findElement(By.xpath("//textarea[@id='invoice_terms']")).sendKeys("Some invoice terms"); // set 'Invoice Process' ieDriver.findElement(By.xpath("//input[@id='invoice_custom_invoice_process']")).sendKeys("Some invoice process"); // wait 5 seconds for view TimeUnit.SECONDS.sleep(5); // save 'invoice' ieDriver.findElement(By.id("btn_save_invoice")).click(); // save link for created invoice for export to output data binding.putAt("invoice_url", ieDriver.getCurrentUrl().toString());
		// wait 5 seconds for view
		TimeUnit.SECONDS.sleep(5);
    ]]></script>
  </selenium>
</selenium-flow>
<export include-original-data="true">
	<single-column name="invoice_url" value="${invoice_url}"/>
</export>

I can see there’s hub URL when I try to run from WF Studio. Changed the port and it’s working now.

@ashapkina @jdhar Can I know how to change the port. Where I can change this settings??

In WF studio, in run configuration, you can change hub URL.

I tried changing the Port in the Hub url - using hub port - 15444 provided in above answers.
My Hub url earlier was - http://127.0.0.1:4444/wd/hub
I modified it to http://127.0.0.1:15444/wd/hub

Still getting the same error. Let me know if i changed it to the correct value.
Also where can we change the port for the Node. ?
Any help appreciated.

@jdhar Please suggest where can we change the port. I tried in the run configuration as mentioned in my comments below.