Winium.Desktop
Winium.Desktop copied to clipboard
Element not found error
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);
}
} }
can you explain the scope of the test clearly? Why would you require automated test to install notepad++? @tamizh143
Hi @tamizh143 I Am Aakash Raval ,i am facing same error or Waring message you are solve this
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.
like this type of error or Waring