Automation of Web based SSH CLIENT PLUGIN script running using Selenium Webdriver

1

I am trying to automate the following scenario:

I have installed a firefox plugin named FireSSH. Now, I have already manually and able to connect my remote server using the key and related parameters. I want to achieve the automation of this manual process of connecting to the remote client using selenium. As, selenium is used for web based automation, hence I have installed web browser based plugin to do SSH using web browser. The problem which I am facing is that I wanted to click on the "open menu" button on Firefox top right corner and within that dialogue I need to click the FireSSH plugin. It gives a prompt with all the credentials configured previously. I just need to click the connect button there and then I will get logged in as SSH client.

Further, I need to execute certain commands on this SSH client interface.

Kindly let me know, how to do that.

pls find the script which I am using but unable to do so.

package erewards2;

<imports ...>

public class putty_Connection {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        FirefoxDriver d1 = new FirefoxDriver();

        d1.get("chrome://firessh/content/firessh.xul#account=SIB2");

        d1.findElementByXPath("html/body/div[2]/div[25]").sendKeys("hello");
    }
}

getting below error

: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIWebNavigation.loadURI] Command duration or timeout: 212 milliseconds Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:18:15' System info: host: 'pcs-PC', ip: '192.168.1.76', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_25' Session ID: c8915b04-23b3-455d-8e33-3bc72f886344 Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, cssSelectorsEnabled=true, databaseEnabled=true, browserName=firefox, handlesAlerts=true, browserConnectionEnabled=true, webStorageEnabled=true, nativeEvents=false, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=30.0}] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595) at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:300) at erewards2.putty_Connection.main(putty_Connection.java:44) Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIWebNavigation.loadURI] Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:18:15' System info: host: 'pcs-PC', ip: '192.168.1.76', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_25' Driver info: driver.version: unknown

java
selenium
ssh
selenium-webdriver
automation
asked on Stack Overflow Apr 17, 2015 by Harsh Nigam • edited Jul 13, 2016 by Sreehari

1 Answer

0

@HarshNigam You are doing is correct but I will suggest this is little long way and procedure based flow.

Working Solution :

Why don't you give a deep dive using PhantomJS? I found it is very helpful in SSH scenarios when you wanted to connect instead of FF plugin. I hope you will get better result with this. All The Best !

answered on Stack Overflow Jul 13, 2016 by NarendraC

User contributions licensed under CC BY-SA 3.0