bbc Posted February 28, 2020 Share Posted February 28, 2020 In our project we got a situation to handle an windows based popup after clicking on 'SignIn' button. We handled it using AutoIt. But the real problem occurs while we are trying to handle popup during parallel execution on local machine. While trying to handle the windows based popup on multiple chrome instances autoIt is not able to handle the popup. Please suggest Notes: I am currently using webdriver Io, Mocha Framework for automation Link to comment Share on other sites More sharing options...
Danp2 Posted February 28, 2020 Share Posted February 28, 2020 8 minutes ago, bbc said: While trying to handle the windows based popup on multiple chrome instances autoIt is not able to handle the popup. Can you show us an example of one of these popups? Also, it would help if you elaborated on "not able to handle". Show us your code and explain what isn't working as expected. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
bbc Posted February 28, 2020 Author Share Posted February 28, 2020 This is the popup I need to handle once login into my application I am writing the following code to handle the pop up , if (os.platform() === "win32") { var au = require('autoit'); browser.pause(1000); au.Init(); // au.WinActivate("MediaCloud"); var processId= au.WinGetProcess("MediaCloud"); // // au.WinWaitActive( processId,60); au.WinActivate(processId); au.Send("{TAB}{ENTER}"); It is working fine when I am launching my application in single chrome browser instance. But when I am doing parallel testing i.e launching the same application URL in different chrome instances( Currently 3 instances), the above pop up isn't handling Link to comment Share on other sites More sharing options...
bbc Posted February 28, 2020 Author Share Posted February 28, 2020 These are the vales I am getting when I inspect the window with autoIt Link to comment Share on other sites More sharing options...
Danp2 Posted February 28, 2020 Share Posted February 28, 2020 Can you post a pic of the actual popup window? Also, the Webdriver spec includes ways to deal with popups. Have you tried dealing with these using the native features of webdriverIO? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
bbc Posted February 28, 2020 Author Share Posted February 28, 2020 This is the pop up . I tried Webdriver io to handle the pop up . But it didn't work me Link to comment Share on other sites More sharing options...
Danp2 Posted February 28, 2020 Share Posted February 28, 2020 That looks like a standard browser alert, so there should be WebdriverIO functionality to handle it. Hint: Check out alertAccept and alertDismiss Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
bbc Posted February 28, 2020 Author Share Posted February 28, 2020 I tried with those functions i.e alertAccept before . I was unable to handle the pop up with any of the WebdriverIo native features . Link to comment Share on other sites More sharing options...
Danp2 Posted February 28, 2020 Share Posted February 28, 2020 Maybe you were using them incorrectly? <shrug> No way to know because you haven't shown us any code. Have you asked for help on their gitter channel? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 28, 2020 Moderators Share Posted February 28, 2020 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Nine Posted February 28, 2020 Share Posted February 28, 2020 If you cannot find a solution with WebDriverIO functions, maybe you could use this : expandcollapse popup#include <APISysConstants.au3> #include <WinAPISysWin.au3> Opt('TrayAutoPause', 0) HotKeySet ("{ESC}", _Exit) OnAutoItExitRegister('OnAutoItExit') Global $hForm = GUICreate('') Global $iMsgCreated = _WinAPI_RegisterWindowMessage('SHELLHOOK') GUIRegisterMsg($iMsgCreated, 'WM_SHELLHOOK') _WinAPI_RegisterShellHookWindow($hForm) While 1 Sleep(100) WEnd ; possible messages : https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registershellhookwindow Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) If $wParam <> $HSHELL_WINDOWACTIVATED Then Return Local $sTitle = WinGetTitle($lParam) Local $sClass = _WinAPI_GetClassName ($lParam) Switch $sClass Case "Chrome_WidgetWin_1" ; do something here Case "Another_Class_Goes_Here" ; do some other things EndSwitch EndFunc ;==>WM_SHELLHOOK Func OnAutoItExit() _WinAPI_DeregisterShellHookWindow($hForm) EndFunc ;==>OnAutoItExit Func _Exit () Exit EndFunc All you need to do is Run this script from the main script, and it will intercept any window created. Simply modify the switch statement. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now