Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi I'm using Winium to test my application getting error"No such element" #361

Open
FWDQK opened this issue Feb 13, 2023 · 0 comments
Open

Comments

@FWDQK
Copy link

FWDQK commented Feb 13, 2023

Code:-
package EsolPages;

import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.winium.DesktopOptions;
import org.openqa.selenium.winium.WiniumDriver;

public class RND
{
public static void main(String[] args) throws InterruptedException, MalformedURLException
{
// TODO Auto-generated method stub
DesktopOptions option = new DesktopOptions();
//option.setApplicationPath("C:\Windows\System32\calc.exe");
option.setApplicationPath("C:\Manulife\eSolution\bin\Manulife.Core.OfflinePlatform.Wpf.exe");
//Thread.sleep(5000);
WiniumDriver driver = new WiniumDriver(new URL("http://localhost:9999"), option);

	 Thread.sleep(5000);
	 System.out.println("Application open");
	 Thread.sleep(6000);
	 //System.out.println(driver.getTitle());
	 
	 driver.findElement(By.xpath("//input[@ng-model='loginData.UserId']")).sendKeys("esoldbsuat20.demo@manulife.com");

// driver.findElement(By.name("Four")).click();
// driver.findElement(By.name("Plus")).click();
// driver.findElement(By.name("Five")).click();
// driver.findElement(By.name("Equals")).click();
// String output = driver.findElement(By.id("CalculatorResults")).getAttribute("Name");
// System.out.println(output);
}
}

Error:-
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Feb 13, 2023 7:25:24 PM org.openqa.selenium.remote.RemoteWebDriver checkNonW3CCapabilities
WARNING: Support for Legacy Capabilities is deprecated; You are sending the following invalid capabilities: [app]; Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
Feb 13, 2023 7:25:25 PM org.openqa.selenium.remote.ProtocolHandshake createSession
WARNING: Support for Legacy Capabilities is deprecated; You are sending the following invalid capabilities: [app]; Please update to W3C Syntax: https://www.selenium.dev/blog/2022/legacy-protocol-support/
Application open
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: 0 milliseconds
For documentation on this error, please visit: https://selenium.dev/exceptions/#no_such_element
Build info: version: '4.8.0', revision: '267030adea'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.9.1'
Driver info: org.openqa.selenium.winium.WiniumDriver
Command: [AwesomeSession, findElement {using=xpath, value=//input[@ng-model='loginData.UserId']}]
Capabilities {app: C:\Manulife\eSolution\bin\M..., args: , debugConnectToRunningApp: false, innerPort: 9998, keyboardSimulator: 1, launchDelay: 0, platformName: ANY}
Session ID: AwesomeSession
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:217)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:169)
at org.openqa.selenium.remote.codec.jwp.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:41)
at org.openqa.selenium.remote.codec.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:83)
at org.openqa.selenium.remote.codec.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:47)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184)
at org.openqa.selenium.winium.WiniumDriverCommandExecutor.execute(WiniumDriverCommandExecutor.java:78)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at org.openqa.selenium.remote.ElementLocation$ElementFinder$2.findElement(ElementLocation.java:162)
at org.openqa.selenium.remote.ElementLocation.findElement(ElementLocation.java:60)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)
at EsolPages.RND.main(RND.java:27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant