bogQ Posted August 28, 2023 Share Posted August 28, 2023 (edited) 41 minutes ago, samibb said: @Danp2 I am using Cryptic Window so i need after i send the command press 'ENTER' to prosed it. Thanks Do not know what "Cryptic Window" is but... Most of udf-s are made so that they set @error macro to some value if their function fail, so if you cant reproduce sample script for us to test, take some time and debug where error is, look at function description from udf for more info to see witch error is, if any is represented in function description and then debug your code... if @error Then ConsoleWrite... Additional note, if your using on normal browser AD blocker, or site have accept cookies option, it can happened that your path from headless and normal browser are two different things so that element xpath location is just wrong. Edited August 28, 2023 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Danp2 Posted August 28, 2023 Author Share Posted August 28, 2023 @samibb Your response isn't helpful because it doesn't provide meaningful details to help us understand your needs. I previously linked to a thread that demonstrates how to properly send Enter with Webdriver. Did you read it? 🤨 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
mLipok Posted August 29, 2023 Share Posted August 29, 2023 (edited) When I print webpage to PDF then I get PDF with embeded fonts: I need to generate PDF with desired font to have standard Windows Font which are not needed to be embeded to the PDF. The reason is PDF file size with embeded Font it always is greater then 150KBytes even if it has no images only about 50 words. Any idea how to use different font in web page in the way to produce PDF via WebDriver with disered font ? EDIT: some findings: https://bugs.chromium.org/p/chromium/issues/detail?id=99125 https://courtneyzhan.medium.com/print-style-sheets-and-export-a-webpage-to-pdf-in-selenium-webdriver-c302ddca996d https://www.w3schools.com/css/css_font.asp Edited August 29, 2023 by mLipok 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...
mLipok Posted August 29, 2023 Share Posted August 29, 2023 btw. https://bugs.chromium.org/p/chromedriver/issues/detail?id=3517 Is it really fixed ? Can somebody print to PDF with non headles in Chrome ? 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...
bogQ Posted August 29, 2023 Share Posted August 29, 2023 (edited) from normal chrome 116.0.5845.111 x64 (smaller coz probably adblock remove something from page ) 3517 - Enable print feature for non-headless - chromedriver.pdf from chromedriver 116.0.5845.96 x64 (runed on website with py, added sleep 1000 seconds, used ctrl+p for printing) 3517 - Enable print feature for non-headless - chromedriver1.pdf Edited August 29, 2023 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
samibb Posted August 29, 2023 Share Posted August 29, 2023 Dear "Cryptic Window" is similar to "command promp" Screen . i am using send("{enter}") and it works. the function _WD_ElementAction dose not have 'ENTER' as Command 'CLICK'. Link to comment Share on other sites More sharing options...
Danp2 Posted August 29, 2023 Author Share Posted August 29, 2023 (edited) On 8/24/2023 at 9:27 AM, samibb said: How can I press 'ENTER' IN CHROME You asked the above. I responded by pointing you to a prior post that shows how to do what you requested. It doesn't sound like you even read the post, so maybe you missed the link that was embedded in my reply. Here it is again to be sure -- https://www.autoitscript.com/forum/topic/201106-webdriver-udf-help-support-ii/page/37/#comment-1463407 Edit: Also, it appears that you are using an outdated version of the UDF Edited August 29, 2023 by Danp2 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
samibb Posted August 30, 2023 Share Posted August 30, 2023 Local $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"browserName": "chrome"}}}' ;SetupChrome() ;_WD_Startup() Local $sessionId = _WD_CreateSession($sDesiredCapabilities) MsgBox(0,0,$sessionId) _WD_Navigate($sessionId, "https://saudiairlines-my.sharepoint.com/:f:/g/personal/sbahwal_saudia_com/EnsNv1MZOuhPgNznypp1IpMBmHGCcC6JEdlhF1TgyOm09g?e=JfVVjK") Local $fileInput = _WD_FindElement($sessionId, $_WD_LOCATOR_ByXPath, "//input[@type='file']") MsgBox(0,0,$fileInput) _WD_ElementAction($sessionId, $fileInput, 'sendKeys', 'C:\Users\11003813\Desktop\REFUND\LIST.txt') ====================================================================================================== __WD_Post ==> Success [0] : HTTP status = 404 _WD_CreateSession ==> Webdriver Exception [10] __WD_Post ==> Success [0] : HTTP status = 404 _WD_Navigate ==> Success [0] : Parameters: URL=https://saudiairlines-my.sharepoint.com/:f:/g/personal/sami_com/EnsNv1MZOuhPgNznypp1IpMBmHGCcC6JEdlhF1TgyOm09g?e=JfVVjK __WD_Post ==> Success [0] : HTTP status = 404 _WD_FindElement ==> Success [0] : Parameters: Strategy=xpath Selector=//input[@type='file'] StartNodeID=Default Multiple=Default ShadowRoot=Default _WD_ElementAction ==> Invalid data type [3] : (Active|Attribute|ComputedRole|ComputedLabel|Clear|Click|CSS|Displayed|Enabled|Name|Property|Rect|Selected|Shadow|Screenshot|Text|Value) $sCommand=>sendkeys This code for copy file from pc. to share folder in OneDrive last step not valid. need your help as usual Thanks Link to comment Share on other sites More sharing options...
Danp2 Posted August 30, 2023 Author Share Posted August 30, 2023 9 minutes ago, samibb said: _WD_CreateSession ==> Webdriver Exception [10] You need to figure out why this command is failing. Other issues -- Take a look at _WD_SelectFiles in the help file. This command is intended to work on your target element. Look at the help file entry for _WD_ElementAction for the valid actions, which you should note that "sendKeys" isn't one of them P.S. You really can't expect us to debug your script for you. Please get in the habit of reviewing your own logs to determine which commands are failing so that you can better troubleshoot your own scripts. samibb 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
samibb Posted September 5, 2023 Share Posted September 5, 2023 Dear @Danp2 is there a function send a massage to whatsapp ? Link to comment Share on other sites More sharing options...
Danp2 Posted September 5, 2023 Author Share Posted September 5, 2023 @samibb Nothing like that currently exists in this UDF. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
_leo_ Posted September 5, 2023 Share Posted September 5, 2023 On 8/30/2023 at 4:56 PM, samibb said: _WD_CreateSession ==> Webdriver Exception [10] @samibb I am having the same problem when initiating the Webdriver. Were you able to solve it and if so, how did you do it? Link to comment Share on other sites More sharing options...
Danp2 Posted September 6, 2023 Author Share Posted September 6, 2023 @_leo_ If you want input from others, then I suggest that you share additional details regarding your setup. For example - Are you sure that you are using the latest version of this udf? Which browser? Browser version? Which webdriver? Version? Can you provide a short script that demonstrates the problem? Are you able to run wd_demo successfully? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 8, 2023 Moderators Share Posted September 8, 2023 Hi, At the request of Danp2 this thread is now closed. Future questions on WebDriver should be posted as specific threads in the General Help and Support Forum. M23 Danp2 and Nine 1 1 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...
Recommended Posts