Danp2 Posted April 4, 2019 Author Share Posted April 4, 2019 @caramen I don't see where the issue is. Then again, I'm not an "expert" when it comes to xpath. Perhaps you could post some complete code that we could run to observe the issue? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted April 5, 2019 Share Posted April 5, 2019 (edited) Yeah no problem./ I have not any issue it's just i cannot find which element I can choose to play with that element.  @Danp2 Seem like this part is hard to fix with forum help.  hmmmmmmmmmmm Maybe there is an other way than Xpath ? Edit: I understood what is happenning. it s becose i have to click the element before spend string inside it or it doesn't work. I have to find a way to know what is html code of the item in first stat. Then send my string after click.  And here I come with an other question then. How to wait an element ? In my little brain ... to associate an element to a var we have to see it. (or at least he have to exists) How to do if i know what element i want to wait but i can't get it into a var? I can't figure out the correct process  Here is my code so you know but i am hidding professional link they have to stay confidentials: expandcollapse popupFunc _FindAllElements () $sElement00 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//span[@class='form_input_undefined']") ; Service Numerique $sElement0 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@class='form_input_undefined']") ; Service Numerique $sElement4 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='SD_REQUEST.AVAILABLE_FIELD_2']") ; NOM USER $sElement5 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='SD_REQUEST.AVAILABLE_FIELD_1']") ; MAIL $sElement6 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='SD_REQUEST.AVAILABLE_FIELD_3']") ; TEL $sElement7 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='SD_REQUEST.AVAILABLE_FIELD_4']") ; Department $sElement8 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='SD_REQUEST.AVAILABLE_FIELD_5']") ; Type EndFunc Func _SendInAllElement () _WD_ElementAction($sSession, $sElement00, 'click' ) _WD_ElementAction($sSession, $sElement0, 'value', ""&$cService ) _WD_ElementAction($sSession, $sElement4, 'value', ""&$cNom ) _WD_ElementAction($sSession, $sElement5, 'value', ""&$cEmail ) _WD_ElementAction($sSession, $sElement6, 'value', ""&$cTel ) _WD_ElementAction($sSession, $sElement7, 'value', ""&$cDepartment ) _WD_ElementAction($sSession, $sElement8, 'value', ""&$cType ) EndFunc Func _StartupWD () SetupChrome() _WD_Startup();Demarrage du WebDriver $sSession = _WD_CreateSession($sDesiredCapabilities);Option du browser _WD_Navigate($sSession, "https://confidential.com");Navigation a Google.com $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='url_account']") ; Account $sElement2 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='url_login']") ; Login $sElement3 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='url_password']") ; Password _WD_ElementAction($sSession, $sElement, 'value', ""&$evAccount) _WD_ElementAction($sSession, $sElement2, 'value', ""&$evLogin) _WD_ElementAction($sSession, $sElement3, 'value', ""&$evPassword) $sElement1 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@type='submit']") _WD_ElementAction($sSession, $sElement1, 'click') $sElement0 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@id='link_bookmark_107']") ; Support N1 _WD_ElementAction($sSession, $sElement0, 'click') WinMove("chromedriver.exe","", -1500 , -1500 ) EndFunc Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true }}}}' EndFunc  Edited April 5, 2019 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 April 5, 2019 Author Share Posted April 5, 2019 4 hours ago, caramen said: And here I come with an other question then. How to wait an element ? Have you taken a look at the function _WD_WaitElement? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted April 5, 2019 Share Posted April 5, 2019 (edited) 26 minutes ago, Danp2 said: Have you taken a look at the function _WD_WaitElement? Yeah in Wd_Helper but how to wait an element that's not existing yet ? I guess i have to attach it first with _WD_FindElement no ?  EDIT: "I guess i am thinking about complicated things when it's just simple as that"  I just have to add my $_WD_LOCATOR_ByXPath without attaching the element ? Edited April 5, 2019 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 April 5, 2019 Author Share Posted April 5, 2019 @caramen Yes, you are over complicating things. Just call _WD_WaitElement in a similar fashion as _WD_FindElement. If you examine the underlying code, you'll see that it just calls _WD_FindElement in a loop. FYI, I believe there are some examples of using this function in this thread or the related one. caramen 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted April 5, 2019 Share Posted April 5, 2019 (edited) 5 minutes ago, Danp2 said: @caramen Yes, you are over complicating things. Just call _WD_WaitElement in a similar fashion as _WD_FindElement. If you examine the underlying code, you'll see that it just calls _WD_FindElement in a loop. FYI, I believe there are some examples of using this function in this thread or the related one. Last question i remember i saw a gettext function somewhere i cannot find it back . it's possible to extract text with WD ?  edit: Ah i just find it back it's in _WD_Alerte. But probably not the thing i am looking for  . Edited April 5, 2019 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 April 5, 2019 Author Share Posted April 5, 2019 @caramen You are likely wanting _WD_ElementAction. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted April 5, 2019 Share Posted April 5, 2019 Thanks i will try the text parameter. Thx to point me out  . 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 April 6, 2019 Share Posted April 6, 2019 (edited) wo man that's so powerfull I love it ! It work. SO if you guys want the text of any element in your webpage you can use this kind of function. Adapt the xpath to your needs. $cText = _GetMyElementTextXPath($sSession,"div","SD_REQUEST_COMMENT1") MsgBox (0,"My text" , $cText) Func _GetMyElementTextXPath($sSession,$elementType,$elementName) $sElement000000 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//"$elementType"[@name='"&$elementName&"']") ; Get the element $cString = _WD_ElementAction($sSession, $sElement000000, 'text' ) ;Insert Text inside my Return $cString Return $cString ;Return my text String EndFunc  Edited April 6, 2019 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 April 6, 2019 Share Posted April 6, 2019 (edited) Oh now i improved my script. And i feel the need of doing somthing i did'nt find. I watched the wd core and helper the function itself but... How to load a page without wait ? I mean actually : 1 I navigate somewhere. 2 I take data 3 I open an other tab 4 I navigate to an other page with my data 5 Then it wait till the page load. 6 Then i attach again to my first page. How to do 6 without 5 ? Edit: Precision : I want to do that only for step 4 not for all the script. Edited April 6, 2019 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 April 6, 2019 Author Share Posted April 6, 2019 @caramen Have you tried changing the pageLoad timeout with _WD_Timeouts (see wd_demo for an example)? caramen 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted April 6, 2019 Share Posted April 6, 2019 35 minutes ago, Danp2 said: @caramen Have you tried changing the pageLoad timeout with _WD_Timeouts (see wd_demo for an example)? oh... was doing _WD_Timeouts($sSession, "500") Ty again. Do you got a tip to dile with element I have to move mouse over to see them ? 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 April 6, 2019 Author Share Posted April 6, 2019 5 minutes ago, caramen said: Do you got a tip to dile with element I have to move mouse over to see them ? Not sure what you are asking here. Please restate and provide website to examine if possible. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted April 6, 2019 Share Posted April 6, 2019 (edited) I can show screenshot. About the website i cannot provide the url. It's not intranet but it's 100% confidential. It contain the base of full France country customers. With personnal info etc... So the only thing i can do is this : The field : "Incident" I need to get the mouse over the field to get this element : And i need to click on it. I know the code of the element but everything I tryed do nothing. <div class="imgPopup_treeview" style="display: inline-block;"> </div> The only working code i have is this but i hate that kind of thing now. $xt=271 $xl=169 $xb=1017 $xr=602 $xtm = $xt $xlm = $xl $pixel = "" $cExitLoopVar = 0 Do $xtm += 15 $xlm += 15 $pixel = PixelSearch($xt,$xl , $xb,$xr , 0xCD1104 ) MouseMove ( $xtm, $xlm ) If IsArray ($pixel) Then $cExitLoopVar = 1 Until $cExitLoopVar = 1 MouseClick ("left" , $pixel[0]+30,$pixel[1] , 1 , 0 )  Edited April 6, 2019 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 April 6, 2019 Author Share Posted April 6, 2019 This should be possible with _WD_Action and the Actions command. See DemoActions in wd_demo.au3 for an example. If you need further assistance, I suggest that you find another publicly-accessible website that use the same web elements / exhibits the same behavior and share that with us. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted April 6, 2019 Share Posted April 6, 2019 Ok Thanks. My final question is there is somthing already make to hide the webdriver from taskbar ? Can you final point me out for it  ?  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 April 6, 2019 Author Share Posted April 6, 2019 Yes, this is controlled by the variable $_WD_DEBUG. If you set it equal to $_WD_DEBUG_None before calling _WD_Startup, then the webdriver console should be launched in a hidden state. caramen 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted April 6, 2019 Share Posted April 6, 2019 (edited) Man i asked lot thing at same time thx for all  I 'll try this WD action and come after several try. Edited April 6, 2019 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 April 6, 2019 Share Posted April 6, 2019 Can you say me where to get information about these parameters ?  $sAction = '{"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"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 April 6, 2019 Author Share Posted April 6, 2019 There is limited information available. The W3C docs are here. I believe I linked to another example earlier this week. Other than that, Google is your best option. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts