Jump to content

Recommended Posts

Posted (edited)
  On 8/28/2023 at 1:51 PM, samibb said:

@Danp2 

I am using Cryptic Window so i need after i send the command press 'ENTER' to prosed it.

Thanks

Expand  

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 by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

  Reveal hidden contents


460px-Thief-4-temp-banner.jpg
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.

 
Posted (edited)

When I print webpage to PDF then I get PDF with embeded fonts:

image.png.8b7adfd82512580b1f0609dd87188aef.png

 

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 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 Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

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 Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (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.pdfFetching info...

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.pdfFetching info...

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

  Reveal hidden contents


460px-Thief-4-temp-banner.jpg
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.

 
Posted

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'.

Posted (edited)
  On 8/24/2023 at 1:27 PM, samibb said:

How can I press 'ENTER' IN CHROME 

Expand  

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 by Danp2
Posted
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

Posted
  On 8/30/2023 at 2:56 PM, samibb said:
_WD_CreateSession ==> Webdriver Exception [10]
Expand  

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.

  • Moderators
Posted

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:

  Reveal hidden contents

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...