Winium.Desktop icon indicating copy to clipboard operation
Winium.Desktop copied to clipboard

Element not found error

Open tamizh143 opened this issue 5 years ago • 3 comments

i am trying to automate installation of notepad++ in my windows 10 operating system . but it showing me the error like below.

Exception in thread "main" org.openqa.selenium.NoSuchElementException: Element cannot be found (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 11.63 seconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06' System info: host: 'ravi-pt2895', ip: '172.24.116.24', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201' Driver info: org.openqa.selenium.winium.WiniumDriver Capabilities [{app=C:\Users\ravi-pt2895\Downloads\npp.7.7.Installer.x64.exe, args=, innerPort=9998, debugConnectToRunningApp=false, keyboardSimulator=1, launchDelay=0, platform=ANY}] Session ID: AwesomeSession *** Element info: {Using=name, value=Next >} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:353) at org.openqa.selenium.remote.RemoteWebDriver.findElementByName(RemoteWebDriver.java:451) at org.openqa.selenium.By$ByName.findElement(By.java:303) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:345) at Installtask.install.main(install.java:21)

this is my code

import org.openqa.selenium.winium.DesktopOptions; import org.openqa.selenium.winium.WiniumDriver; import org.openqa.selenium.By; import java.net.MalformedURLException; import java.net.URL; public class install {

public static void main(String[] args) throws MalformedURLException, InterruptedException {


{
    DesktopOptions option = new DesktopOptions();
	option.setApplicationPath("C:\\Users\\ravi-pt2895\\Downloads\\npp.7.7.Installer.x64.exe");
	Thread.sleep(5000);
	
	WiniumDriver driver = new WiniumDriver(new URL("http://localhost:9999"), option);
	
	driver.findElement(By.id("1")).click();
	Thread.sleep(2000);
	driver.findElement(By.name("Next >")).click(); 
	Thread.sleep(2000);
	driver.findElement(By.name("I Agree")).click(); 
	Thread.sleep(2000);
	driver.findElement(By.name("Next >")).click(); 
	Thread.sleep(2000);
	driver.findElement(By.name("Next >")).click(); 
	Thread.sleep(2000);
	driver.findElement(By.name("Create Shortcut on Desktop")).click(); 
	Thread.sleep(2000);
	driver.findElement(By.name("Install")).click(); 
	Thread.sleep(2000);
	
}

} }

tamizh143 avatar May 24 '19 05:05 tamizh143

can you explain the scope of the test clearly? Why would you require automated test to install notepad++? @tamizh143

nananand7 avatar Jan 30 '20 09:01 nananand7

Hi @tamizh143 I Am Aakash Raval ,i am facing same error or Waring message you are solve this

akashraval0311 avatar May 07 '22 06:05 akashraval0311

Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06' System info: host: 'LAPTOP-0EKQPOCL', ip: '192.168.0.109', os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '18.0.1.1' Driver info: driver.version: WiniumDriver at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:129) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142) at org.openqa.selenium.winium.WiniumDriver.(WiniumDriver.java:84) at desktop123.Demo.main(Demo.java:16) Caused by: org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9999 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: no further information Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06' System info: host: 'LAPTOP-0EKQPOCL', ip: '192.168.0.109', os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '18.0.1.1' Driver info: driver.version: WiniumDriver at org.openqa.selenium.winium.WiniumDriverCommandExecutor.execute(WiniumDriverCommandExecutor.java:86) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:620) ... 5 more Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:9999 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: no further information 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:71) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:143) at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:89) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)

like this type of error or Waring

akashraval0311 avatar May 07 '22 10:05 akashraval0311