NolleWed Posted September 19, 2022 Share Posted September 19, 2022 (edited) but my other problem is not solved. What did I do if there is no ID I can search for? All other buttons have this HTML code, only the value is the difference and the form where the button lies: <input type="submit" value="XXX"> example for a button in form 4: <input type="submit" value="AKM-TR Weitergeleitet"> $FCM_FORMULAR_PPC_DETAILS2 = _IEFormGetObjByName($oIE, "fcmPpcDetailsForm",4) _IEFormSubmit ($FCM_FORMULAR_PPC_DETAILS2, "AKM-TR Weitergeleitet") _IELoadWait($oIE) How can I find this elements and click on it? Edited September 19, 2022 by NolleWed Link to comment Share on other sites More sharing options...
Danp2 Posted September 19, 2022 Author Share Posted September 19, 2022 @NolleWedThere is a list of tools in the Webdriver wiki page that are designed to assist you in identifying the correct xpath or CSS selector. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NolleWed Posted September 20, 2022 Share Posted September 20, 2022 14 hours ago, Danp2 said: @NolleWedThere is a list of tools in the Webdriver wiki page that are designed to assist you in identifying the correct xpath or CSS selector. With this link I tried to find out the xpath, but I don´t know what to do: How to search by Xpath/Css in Chrome Developer Tools? | testerlive (wordpress.com) With F12 I open the console and find the element in HTML code like I always do it <input type="submit" value="AKM-TR Weitergeleitet"> Then I went to console and type in $x("//input") and get 96 results The one I need is this: 71: <input type="submit" value="Abbruch ausführen"> accept: "" accessKey: "" accessKeyLabel: "" align: "" alt: "" assignedSlot: null attributes: NamedNodeMap [ type="submit", value="Abbruch ausführen" ] autocomplete: "" autofocus: false baseURI: "https://prodtalos.de.pri.o2.com/talos/fcm/ppc/details.do?command=view&fcmId=158402685" checked: false childElementCount: 0 childNodes: NodeList [] children: HTMLCollection { length: 0 } classList: DOMTokenList [] className: "" clientHeight: 18 clientLeft: 2 clientTop: 2 clientWidth: 116 contentEditable: "inherit" dataset: DOMStringMap(0) defaultChecked: false defaultValue: "Abbruch ausführen" dir: "" disabled: false draggable: false files: null firstChild: null firstElementChild: null form: <form name="fcmPpcDetailsForm" method="post" action="/talos/fcm/ppc/details.do"> formAction: "https://prodtalos.de.pri.o2.com/talos/fcm/ppc/details.do?command=view&fcmId=158402685" formEnctype: "" formMethod: "" formNoValidate: false formTarget: "" height: 0 hidden: false id: "" indeterminate: false innerHTML: "" innerText: "" isConnected: true isContentEditable: false labels: NodeList [] lang: "" lastChild: null lastElementChild: null list: null localName: "input" max: "" maxLength: -1 min: "" minLength: -1 multiple: false name: "" namespaceURI: "http://www.w3.org/1999/xhtml" nextElementSibling: null nextSibling: #text " " nodeName: "INPUT" nodeType: 1 nodeValue: null nonce: "" offsetHeight: 22 offsetLeft: 336 offsetParent: <td colspan="4" align="center"> offsetTop: 0 offsetWidth: 120 onabort: null onanimationcancel: null onanimationend: null onanimationiteration: null onanimationstart: null onauxclick: null onbeforeinput: null onblur: null oncanplay: null oncanplaythrough: null onchange: null onclick: null onclose: null oncontextmenu: null oncopy: null oncuechange: null oncut: null ondblclick: null ondrag: null ondragend: null ondragenter: null ondragexit: null ondragleave: null ondragover: null ondragstart: null ondrop: null ondurationchange: null onemptied: null onended: null onerror: null onfocus: null onformdata: null onfullscreenchange: null onfullscreenerror: null ongotpointercapture: null oninput: null oninvalid: null onkeydown: null onkeypress: null onkeyup: null onload: null onloadeddata: null onloadedmetadata: null onloadend: null onloadstart: null onlostpointercapture: null onmousedown: null onmouseenter: null onmouseleave: null onmousemove: null onmouseout: null onmouseover: null onmouseup: null onmozfullscreenchange: null onmozfullscreenerror: null onpaste: null onpause: null onplay: null onplaying: null onpointercancel: null onpointerdown: null onpointerenter: null onpointerleave: null onpointermove: null onpointerout: null onpointerover: null onpointerup: null onprogress: null onratechange: null onreset: null onresize: null onscroll: null onseeked: null onseeking: null onselect: null onselectstart: null onstalled: null onsubmit: null onsuspend: null ontimeupdate: null ontoggle: null ontransitioncancel: null ontransitionend: null ontransitionrun: null ontransitionstart: null onvolumechange: null onwaiting: null onwebkitanimationend: null onwebkitanimationiteration: null onwebkitanimationstart: null onwebkittransitionend: null onwheel: null outerHTML: "<input type=\"submit\" value=\"Abbruch ausführen\">" ownerDocument: HTMLDocument https://prodtalos.de.pri.o2.com/talos/fcm/ppc/details.do?command=view&fcmId=158402685 parentElement: <td colspan="4" align="center"> parentNode: <td colspan="4" align="center"> part: DOMTokenList [] pattern: "" placeholder: "" prefix: null previousElementSibling: null previousSibling: #text " " readOnly: false required: false scrollHeight: 18 scrollLeft: 0 scrollLeftMax: 0 scrollTop: 0 scrollTopMax: 0 scrollWidth: 116 selectionDirection: null selectionEnd: null selectionStart: null shadowRoot: null size: 20 slot: "" spellcheck: false src: "" step: "" style: CSS2Properties(0) tabIndex: 0 tagName: "INPUT" textContent: "" textLength: 17 title: "" type: "submit" useMap: "" validationMessage: "" validity: ValidityState { valueMissing: false, typeMismatch: false, patternMismatch: false, … } value: "Abbruch ausführen" valueAsDate: null valueAsNumber: NaN webkitEntries: Array [] webkitdirectory: false width: 0 willValidate: true <prototype>: HTMLInputElementPrototype { stepUp: stepUp(), stepDown: stepDown(), checkValidity: checkValidity(), … } But now I don´t know how to put this in an xpath code 😌 Normaly I use //input[@name='xxx'] or //input[@src='xxx'] or //input[@id='xxx'] , but there is no name, scr or id Please help Link to comment Share on other sites More sharing options...
Danp2 Posted September 20, 2022 Author Share Posted September 20, 2022 37 minutes ago, NolleWed said: But now I don´t know how to put this in an xpath code If you used one of the free tools like SelectorsHub, it would automatically supply you with an xpath selector like //input[@value='AKM-TR Weitergeleitet'] Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
NolleWed Posted September 26, 2022 Share Posted September 26, 2022 Can´t use the free tool, because I have no rights to install tools on my PC (at work) all buttons with type submit in the HTML code: <input type="submit" value="XXX"> work fine with this code: Local $sButton2 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@value='XXX']") _WD_ElementAction($sSession, $sButton2, 'click') _WD_LoadWait($sSession, 2000) Thanks Link to comment Share on other sites More sharing options...
Danp2 Posted September 26, 2022 Author Share Posted September 26, 2022 @NolleWedYou can't even install a browser extension? 🤨 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
PaulS Posted September 28, 2022 Share Posted September 28, 2022 (edited) I'm working on an AutoIT script to keep Edge Webdriver up to date. When the logged in user has admin permissions to the computer, the script works well. If not, both _WD_IsLatest_Release and _WD_UpdateDriver fail with @error=$_WD_ERROR_GeneralError. The update also fails when logged in as a standard user using RunAs administrator. I have attached the script and one of the log files for reference purposes. At 08:12 in the log file, I ran the script logged in as an admin user. All other attempts were run as a standard user. Any suggestions? WebDriverUpdate.au3 WebDriverUpdateDebug.log Edited September 28, 2022 by PaulS Link to comment Share on other sites More sharing options...
Danp2 Posted September 28, 2022 Author Share Posted September 28, 2022 @PaulSIf you look at _WD_IsLatestRelease, it is simply performing an InetRead against the URL "https://github.com/Danp2/au3WebDriver/releases/latest", which shouldn't require any special permission AFAIK. What OS are you using? What do you get for output from the following? Local $sGitURL = "https://github.com/Danp2/au3WebDriver/releases/latest" Local $sResult, $aOptions = [0, 1, 2, 3, 4, 8] For $iOption In $aOptions $sResult = InetRead($sGitURL, $iOption) ;### Debug CONSOLE ↓↓↓ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iOption = ' & $iOption & ' > Error code: ' & @error & @CRLF) Next P.S. I believe there have been past discussions where InetRead was failing on attempts to connect to Github due to security protocols. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
PaulS Posted September 28, 2022 Share Posted September 28, 2022 @Danp2 Thanks for the quick reply. Your comment about InetRead failing due to security protocols got me thinking, so I checked our web content filter. Guess what...both github.com and msedgedriver.azureedge.net were being blocked for the standard user, and not for the admin user. THANK YOU!!! Danp2 1 Link to comment Share on other sites More sharing options...
NolleWed Posted September 30, 2022 Share Posted September 30, 2022 On 9/26/2022 at 1:36 PM, Danp2 said: @NolleWedYou can't even install a browser extension? 🤨 no, Add-Ons are not allowed Danp2 1 Link to comment Share on other sites More sharing options...
HJL Posted October 10, 2022 Share Posted October 10, 2022 (edited) On 9/30/2022 at 11:16 AM, NolleWed said: no, Add-Ons are not allowed Look here: https://tiprumahminimalis.com/de/wie-man-xpath-in-chrome-browser-findet/ and for other browsers it is similiar. Edited October 10, 2022 by HJL Link to comment Share on other sites More sharing options...
HJL Posted October 10, 2022 Share Posted October 10, 2022 (edited) Hi Dan, thanks again for your work! Your function _WD_UpdateDriver() checks and installs current webdriver if necessary. In my program I want to show the existing and the new version before the update. I have so far only the workaround that I modify the function in wd-helper, so put 2 global variables, which I can then use in my program. However, my modification is gone with each update from you. Is there a way to get the values of $sDriverCurrent and $sDriverLatest somehow also "outside" as global just as information? Edited October 10, 2022 by HJL Link to comment Share on other sites More sharing options...
HJL Posted October 10, 2022 Share Posted October 10, 2022 @mLipok Some time ago you wrote about "document.readyState". I don't get how I can use this in connection with Dan's UDF / AutoIt. Link to comment Share on other sites More sharing options...
Danp2 Posted October 10, 2022 Author Share Posted October 10, 2022 @HJL_WD_LoadWait is already using this property. The default is to wait until the web page is fully loaded, but this can be modified using the $iState parameter (recent addition by @mLipok) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted October 10, 2022 Author Share Posted October 10, 2022 33 minutes ago, HJL said: Is there a way to get the values of $sDriverCurrent and $sDriverLatest somehow also "outside" as global just as information? _WD_GetWebDriverVersion can be used to obtain the $sDriverCurrent. There currently isn't a way for you to get $sDriverLatest unless you download the file into a temporary location and then use the above function on it. ; Remarks .......: When $bForce = Null, then the function will check for an updated webdriver without actually performing the update. ; In this scenario, the return value indicates if an update is available. In theory, we could change the functionality of _WD_UpdateDriver so that it returns an array containing these values when $bForce = Null. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
mLipok Posted October 10, 2022 Share Posted October 10, 2022 1 hour ago, HJL said: Your function _WD_UpdateDriver() checks and installs current webdriver if necessary. In my program I want to show the existing and the new version before the update. hm...it can be handy in some way in one of my case. I have a project where browser is only on local network with strongly protected area. I need to get browser version, store it in INI then update driver on different computer with internet access. So I need to check browser version, store them, and download related driver later. This is one of my case on my TODO list. @Danp2 can we combine this two fatures together ? Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
HJL Posted October 10, 2022 Share Posted October 10, 2022 (edited) That's output of my program, but works in the moment only with the workaround of 2 global variables. Edited October 10, 2022 by HJL Link to comment Share on other sites More sharing options...
Danp2 Posted October 10, 2022 Author Share Posted October 10, 2022 @mLipokI don't understand what you mean. Don't you already have what you need with _WD_GetBrowserVersion? @HJLLet me know if my proposal above will work for you. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
hahnhwang Posted October 18, 2022 Share Posted October 18, 2022 (edited) Hi @Danp2 I didnt know any Programing language before, but after 1 week finding and copy from this forum, Now I can code by myself a simple script to let my PC automatically grab data from some url and save them. But all of these urls are simple, so I easily copy whole of the content then edit the strings step by step And now, I want to grab the data in a not simple website (with me), and I found this topic. Could you help me how to get the number of shipments in this URL: https://importkey.com/search/TRUONG THANH INCORPORATED COMPANY with the Xpath "//*[@id="mat-tab-label-3-0"]/div/span/app-number-viewerapp" Thanks. Edited October 18, 2022 by hahnhwang Link to comment Share on other sites More sharing options...
SkysLastChance Posted October 18, 2022 Share Posted October 18, 2022 (edited) @hahnhwang https://www.autoitscript.com/wiki/WebDriver#FAQ #7 You don't need an array in this case. However, Local $sElement = _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, '//*[@id="mat-tab-label-0-0"]/div/span/app-number-viewerapp', 100, 5000) Local $sText = _WD_ElementAction($sSession, $sElement, 'property', 'innerText') MsgBox(0, "Total", $sText) Edited October 18, 2022 by SkysLastChance hahnhwang 1 You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott Link to comment Share on other sites More sharing options...
Recommended Posts