I am automating my Home windows utility.
I am utilizing Winapp driver and Java language for automation. I’m capturing the net components utilizing UI Spy Device.
My utility is loading, nonetheless I can not automate the login web page.
I am getting the next error:
My Code:
public class Reporter
{
non-public static WindowsDriver driver;
public static void fundamental(String args[])
throws MalformedURLException, InterruptedException
{
DesiredCapabilities capabilities = new DesiredCapabilities();
String homePath = System.getenv("USERPROFILE");
capabilities.setCapability("app", homePath + "AppDataNativeApps2.0HHCZT7OJ.D3761K3K288.OXHbase..tion_6e5be371fe594b2d_0001.0000_aad96dff3b16369b");
WindowsDriver Session = new WindowsDriver(new URL("http://127.0.0.1:4723"), capabilities);
Assert.assertNotNull(Session);
Session.handle().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
DesiredCapabilities Appcapabilities = new DesiredCapabilities();
Appcapabilities.setCapability("app", "Root");
WindowsDriver AppSession = new WindowsDriver(new URL("http://127.0.0.1:4723"), Appcapabilities);
Thread.sleep(5000);
WebDriverWait wait=new WebDriverWait(AppSession, 30);
AppSession.findElementByAccessibilityId("txtUserName").sendKeys("r_nave");
AppSession.findElementByAccessibilityId("txtPassword").sendKeys("naveen");
AppSession.findElementByAccessibilityId("btnLogin").click on();
}
}
Error::
Jul 16, 2018 10:19:47 AM org.openqa.selenium.distant.ProtocolHandshake
createSession INFO: Detected dialect: OSS Jul 16, 2018 10:19:47 AM
org.openqa.selenium.distant.ProtocolHandshake createSession INFO:
Detected dialect: OSS Exception in thread “fundamental”
org.openqa.selenium.NoSuchElementException: A component couldn’t be
positioned on the web page utilizing the given search parameters. (WARNING: The
server didn’t present any stacktrace data) Command period or
timeout: 0 milliseconds For documentation on this error, please go to:
http://seleniumhq.org/exceptions/no_such_element.html Construct information:
model: ‘3.5.3’, revision: ‘a88d25fe6b’, time:
‘2017-08-29T12:42:44.417Z’ System information: host: ‘ANTONYW10’, ip:
‘10.246.0.91’, os.identify: ‘Home windows 10’, os.arch: ‘amd64’, os.model:
‘10.0’, java.model: ‘10.0.1’ Driver information:
io.appium.java_client.home windows.WindowsDriver Capabilities [{app=Root,
javascriptEnabled=true, platformName=XP, platform=XP}] Session ID:
BB465F8F-3CE3-453C-99CB-BB517378A6B2
*** Aspect information: {Utilizing=accessibility id, worth=txtUserName}
Now it is working for me that I put thread.sleep 20000