CYCho Posted January 22, 2018 Posted January 22, 2018 (edited) Browsers seem to have a built-in feature to insert a check box (Prevent this page from creating additional dialogues) into the message box created by an web site. This check box seems to appear when the same message box is triggered in succession within a short span of time. My problem is that AutoIt cannot read the text of the IE11 message box when this check box is included. I started to experence this after my Windows 10 was updated to Anniversay Update. I would like to know if anyone has experienced the same thing and if there is a solution to let the AutoIt read the text. Edited January 23, 2018 by CYCho zPlayer - A Small Audio and Video Player
XaelloNegative Posted January 23, 2018 Posted January 23, 2018 I think you could use your Window info tool to get the classes and/or ClassNN, title and instances. Let us know what it says, so we could explore other options. ~XN~
CYCho Posted January 23, 2018 Author Posted January 23, 2018 (edited) On 2018년 1월 24일 at 1:27 AM, XaelloNegative said: I think you could use your Window info tool to get the classes and/or ClassNN, title and instances. Let us know what it says, so we could explore other options. Thank you for your attention. This is the screen capture. It is in Korean, but basically au3info can detect only the title, the size of the message box and the text "Confirm" which is a button. The title says "Message from web page." I can think of using the size as an identifier of this message box, but I am afraid I may encounter same size message boxes with different contexts, requring me to take different actions after the message is closed. Edited February 7, 2018 by CYCho zPlayer - A Small Audio and Video Player
XaelloNegative Posted January 24, 2018 Posted January 24, 2018 14 hours ago, CYCho said: Thank you for your attention. This is the screen capture. It is in Korean, but basically au3info can detect only the title, the size of the message box and the text "Confirm" which is a button. The title says "Message from web page." I can think of using the size as an identifier of this message box, but I am afraid I may encounter same size message boxes with different contexts, requring me to take different actions after the message is closed. Well done. At least you have the title and some identifiers, we could work with that. Now, what do you want to do with the said pop-up? ~XN~
CYCho Posted January 24, 2018 Author Posted January 24, 2018 I will close the pop-up. There are 3 different options I can choose depending on the context of the pop-up. Without knowing what the pop-up says, I can't decide where to go. zPlayer - A Small Audio and Video Player
CYCho Posted February 5, 2018 Author Posted February 5, 2018 Since each pop-up message has a distinct pixel checksum value, I think PixelChecksum() funtion can solve my problem, even though I still want to be able to read the text. I found that it takes less than 20 millisecs to get the pixel checksum of a pop-up window and that's fast enough. zPlayer - A Small Audio and Video Player
CYCho Posted February 5, 2018 Author Posted February 5, 2018 I found out that the PixelChecksum() function produces different values on different computers. The values seem to be consistent in one computer. It seems that different graphic cards produce different values for otherwise identical pop-up message. zPlayer - A Small Audio and Video Player
Danp2 Posted February 5, 2018 Posted February 5, 2018 You may want to take a look at the Web Driver UDF, as it has the ability to retrieve the text from an alert window. Latest Webdriver UDF Release Webdriver Wiki FAQs
CYCho Posted February 5, 2018 Author Posted February 5, 2018 1 hour ago, Danp2 said: You may want to take a look at the Web Driver UDF, as it has the ability to retrieve the text from an alert window. Thanks for your suggestion. I am not familiar with web driver, so please pardon me if my question is too silly. In your documentation, I see the links for Chrome and FireFox web drivers but none for IE. Does this UDF work on IE as well? I use IE because I have to use -noframemerging command line to establish several independent sessions at the same time. zPlayer - A Small Audio and Video Player
Danp2 Posted February 5, 2018 Posted February 5, 2018 Based upon the recent feedback from @Chimp, I would say yes. Not all Web Drivers have fully implemented the W3C protocol. You can see details on the IE implementation here. You may want to write a test script just to see if you can attach to an existing instance of IE and then interact with it, read the Alert text, etc. P.S. This is an early rendition of the UDF so things are likely to change slightly as development continues. Latest Webdriver UDF Release Webdriver Wiki FAQs
CYCho Posted February 7, 2018 Author Posted February 7, 2018 (edited) Thank you Danp2. I failed with MicrosoftWebDriver on IE, but was successful with Chrome. Chrome did not produce "Prevent this page..." checkbox, and au3info could not detect the Chrome pop-up anyway, but your UDF could detect the pop-up and accurately read the text. I think I now see a light at the end of the tunnel. By the way, how would you keep the sessions alive while I do the logins, navigate and do other chores? Should I place a while loop after the sessions are created and trigger functions by hot keys? P.S. It is good to learn that Chrome multisession is the norm under your UDF. Edited April 25, 2018 by CYCho zPlayer - A Small Audio and Video Player
Danp2 Posted February 7, 2018 Posted February 7, 2018 I believe the session will remain alive until you explicitly close it or something else causes the driver/browser to close. You just save the session ID when it is first created and then continue using it in your script as needed. Latest Webdriver UDF Release Webdriver Wiki FAQs
CYCho Posted February 7, 2018 Author Posted February 7, 2018 Since I have to use _WD_Alert($Session, "gettext") function intermittently while web pages are open, I have to keep the session alive. I'm using a while loop and it works great. The only complaint I can think of is that I can't get rid of the DOS box while session is alive. Thanks a lot. zPlayer - A Small Audio and Video Player
Danp2 Posted February 7, 2018 Posted February 7, 2018 Have you tried adding this at the beginning of your script? $_WD_DEBUG = False This should launch the web driver console hidden. Latest Webdriver UDF Release Webdriver Wiki FAQs
CYCho Posted February 7, 2018 Author Posted February 7, 2018 That's cute. Thank you. zPlayer - A Small Audio and Video Player
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