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

Unable to handle the javaw popups #2027

Open
satishh107 opened this issue Aug 21, 2024 · 0 comments
Open

Unable to handle the javaw popups #2027

satishh107 opened this issue Aug 21, 2024 · 0 comments

Comments

@satishh107
Copy link

I'm trying to automate the VS .net application with some inbuilt features. But for some reason the winapp driver is unable to handle the java popup that comes up after performing some action.

I get the error as below.

Here's a sample code i'm using in the script

driver.FindElementByXPath("//*[@classname='MenuItem'][@name='Add Selected Project(s)...']").Click();

Above operation will invoke the javaw popup.

Thread.Sleep(TimeSpan.FromSeconds(5));
var allWindowHandles = driver.WindowHandles;
driver.SwitchTo().Window(allWindowHandles[0]);
Thread.Sleep(TimeSpan.FromSeconds(5));
var popupWindow = driver.FindElementByXPath("//[contains(@name,'Add to Source Control')]");
driver.SwitchTo().Window(popupWindow.GetAttribute("NativeWindowHandle"));
Thread.Sleep(TimeSpan.FromSeconds(5));
var okButton = driver.FindElementByXPath("//
[@classname='Button'][@name='OK']");
okButton.Click();

Ignoring new object and keeping existing one

Exception: Encountered element sharing the same runtimeId 7.10972.852373

new Object {Start Window, MenuItem, 7.10972.852373}
runtimeId 7.10972.852373
className MenuItem
name Start Window
NativeWindowHandle 0

existing Object {Start Window, MenuItem, 7.10972.852373}
runtimeId 7.10972.852373
className MenuItem
name Start Window
NativeWindowHandle 0

Ignoring new object and keeping existing one

Exception: Encountered element sharing the same runtimeId 7.10972.19873928

new Object {Refresh, MenuItem, 7.10972.19873928}
runtimeId 7.10972.19873928
className MenuItem
name Refresh
NativeWindowHandle 0

existing Object {Refresh, MenuItem, 7.10972.19873928}
runtimeId 7.10972.19873928
className MenuItem
name Refresh
NativeWindowHandle 0

Ignoring new object and keeping existing one

HTTP/1.1 200 OK
Content-Length: 102
Content-Type: application/json

{"sessionId":"D6BA4765-C718-4B3B-9456-5922D9B2BC6F","status":0,"value":{"ELEMENT":"7.10972.66284361"}}

==========================================
POST /session/D6BA4765-C718-4B3B-9456-5922D9B2BC6F/element/7.10972.66284361/click HTTP/1.1
Accept: application/json, image/png
Content-Length: 2
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
User-Agent: selenium/3.141.0 (.net windows)
X-Idempotency-Key: 32d9b82e-3fe5-4a65-9088-cd9b19478afc

{}
HTTP/1.1 200 OK
Content-Length: 63
Content-Type: application/json

{"sessionId":"D6BA4765-C718-4B3B-9456-5922D9B2BC6F","status":0}

==========================================
GET /session/D6BA4765-C718-4B3B-9456-5922D9B2BC6F/window_handles HTTP/1.1
Accept: application/json, image/png
Cache-Control: no-cache
Host: 127.0.0.1:4723
User-Agent: selenium/3.141.0 (.net windows)
X-Idempotency-Key: 88a0308f-5071-4903-88c0-dccdcf8fe511

HTTP/1.1 500 Internal Error

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