Nine Posted January 5, 2021 Share Posted January 5, 2021 Verify if you got a frame embedding this element. “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...
caramen Posted January 5, 2021 Share Posted January 5, 2021 2 minutes ago, Nine said: Verify if you got a frame embedding this element. Explain me please ? My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Cyphon68 Posted January 5, 2021 Share Posted January 5, 2021 (edited) 41 minutes ago, Cyphon68 said: If that doesn't work, you didn't provide us enough code to help you. Edited January 5, 2021 by Cyphon68 Link to comment Share on other sites More sharing options...
caramen Posted January 5, 2021 Share Posted January 5, 2021 (edited) 19 minutes ago, Nine said: Verify if you got a frame embedding this element. @Nine I can see that in the root source code of this page : How to work with frames ? Edited January 5, 2021 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 5, 2021 Author Share Posted January 5, 2021 1 hour ago, caramen said: How to work with frames ? Maybe take a look at wd_demo.au3 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted January 5, 2021 Share Posted January 5, 2021 I got this return, but It does not rly help me : _WD_ExecuteScript: {"value":4}... Frames=4 _WD_ExecuteScript: {"value":true}... TopWindow=True My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2021 Author Share Posted January 6, 2021 @caramen Perhaps this revised example will help you -- Func DemoFrames() Local $sElement _WD_Navigate($sSession, "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe") ConsoleWrite("Frames=" & _WD_GetFrameCount($sSession) & @CRLF) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//iframe[@id='iframeResult']") _WD_FrameEnter($sSession, $sElement) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//iframe") _WD_FrameEnter($sSession, $sElement) $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@id='w3loginbtn']") _WD_ElementAction($sSession, $sButton, 'click') _WD_LoadWait($sSession, 2000) _WD_FrameLeave($sSession) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) _WD_FrameLeave($sSession) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) EndFunc Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted January 6, 2021 Share Posted January 6, 2021 (edited) I see nothing happen on the website... bro It's me that is retarded again lol 😛 ? Ah I had to add sleep to accept cookies, and then I see it push log in button. Edited January 6, 2021 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted January 6, 2021 Share Posted January 6, 2021 Okok. So If I don't understand the way it works, how, and where to start ? What do I have to understand ? What is a Frame concretely ? From now, I understand that the syntax is correct. But I cannot find the element because he is hidden by the frame or something like that ? So I understand I have to touch the frame before touching the element ? My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 6, 2021 Author Share Posted January 6, 2021 @caramen You can't interact with an element until you switch to the correct browsing context. You can switch browsing contexts using _WD_Window. You can also use the helper functions _WD_FrameEnter & _WD_FrameLeave, which call _WD_Window behind the scenes. Please remember that this is the Webdriver UDF support thread. Since your question is of a general nature and not Webdriver specific, you may want to start a separate thread dealing with website frames. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted January 6, 2021 Share Posted January 6, 2021 (edited) 4 hours ago, Danp2 said: @caramen You can't interact with an element until you switch to the correct browsing context. You can switch browsing contexts using _WD_Window. You can also use the helper functions _WD_FrameEnter & _WD_FrameLeave, which call _WD_Window behind the scenes. Please remember that this is the Webdriver UDF support thread. Since your question is of a general nature and not Webdriver specific, you may want to start a separate thread dealing with website frames. Now I got it. These functions are like lever/ Sorry about the out of context question I thought that was in your scope. Edited January 6, 2021 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted January 7, 2021 Share Posted January 7, 2021 Lesson learned ! 😛 thanks guys. Func EnvoyerInfoMasque () Local $sFrame = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//frame[@id='main']") ConsoleWrite("Frames=" & _WD_GetFrameCount($sSession) & @CRLF) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) _WD_FrameEnter($sSession, $sFrame) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//textarea[contains(@id,'icmtDE_SYMPAPPEL')]") _WD_ElementAction($sSession, $sElement, 'text', 'Caraxxx@hotmail.com1' ) _WD_ElementAction($sSession, $sElement, 'value', 'Caraxxx@hotmail.com1' ) _WD_LoadWait($sSession, 2000) _WD_FrameLeave($sSession) EndFunc My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2021 Author Share Posted January 7, 2021 3 minutes ago, caramen said: _WD_ElementAction($sSession, $sElement, 'text', 'Caraxxx@hotmail.com1' ) The 'text' option only retrieves the element text, not set it. Therefore, this line isn't doing anything and can be eliminated. Quote _WD_LoadWait($sSession, 2000) Don't see why this would be needed here. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted January 7, 2021 Share Posted January 7, 2021 1 minute ago, Danp2 said: Quote _WD_LoadWait($sSession, 2000) Don't see why this would be needed here. On 1/6/2021 at 1:47 AM, Danp2 said: this revised example You did that in the example, I just did same. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2021 Author Share Posted January 7, 2021 1 minute ago, caramen said: You did that in the example, I just did same. That true. However, in my example I performed a click action on a button before calling _WD_LoadWait. There is no such action being taken in the script you posted, so I stand by my original assessment. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Cyphon68 Posted January 7, 2021 Share Posted January 7, 2021 If i have the array of handles, is there a way of getting the HTML titles or URLs from those handles without switching to them? I know i can _WD_Window switch, then _WD_Action($sSession,"title") to get the titles once i switch...but I was hoping i might be able to pass a handle to _WD_Action to get the title without switching the visual pane. Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2021 Author Share Posted January 7, 2021 @Cyphon68 Not that I am aware of. You may be able to do it with _WD_Execute and some Javascript. Can you provide further details on your goals / why you need this information? That may lead us in a different direction. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Cyphon68 Posted January 7, 2021 Share Posted January 7, 2021 There's a webpage that i'm trying to automate, and when a certain step is taken, it launches an unecessary pop up. I don't want to disable all pop ups for the browser, I just want to locate this pop up, get a handle to it, and close it. Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2021 Author Share Posted January 7, 2021 I would do it like this -- Save the current tab's handle Use _WD_Attach to temporarily switch to the popup window Use _WD_Window to close the popup Switch back to the original tab using the saved handle Another option would be something like this -- Save the current tab's handle Gather the list of current handles Perform the action that produces the popup Gather the list of current handles (2nd time) Compare the two sets of handles and close any that don't exist in the initial set Switch back to the original tab using the saved handle Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Cyphon68 Posted January 7, 2021 Share Posted January 7, 2021 ok, one major thing i just figured out, haha. _WD_Window($sSession, 'handles') returns the raw handle, not the string for the handle that you'd need for doing things like switching and closing. Link to comment Share on other sites More sharing options...
Recommended Posts