Jump to content

Recommended Posts

Posted (edited)

@Jemboy, Try this:
 

$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwithes": [ "enable-automation"], "useAutomationExtension": false,"prefs": {"credentials_enable_service": false}, "binary": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"}}}}'

 

Edited by CYCho
Posted (edited)
On 10/9/2020 at 11:56 PM, Danp2 said:

@Jemboy Take a look at _WD_UpdateDriver. You can use it from within your main script to update the webdriver for chome, firefox, and edge.

Nice!👍 I looked at the function, and I presume folder/file rights have to be done by the  "programmer", so _WD_UpdateDriver had the rights to write the driver ?
Also will calling the _WD_UpdateDriver in a script update the driver every time ?
My own update routine checks Chrome and Chromedriver version and only update if the Chrome version is > than Chromedriver.

Edited by Jemboy
Posted
On 10/9/2020 at 11:59 PM, Danp2 said:

See FAQ 4 in the Webdriver Wiki for the solution to this issue.

Thanks @Danp2 I had seen the Wiki on this subject but I did not realise I had to use double \ to escsape in the path.
So that's probably why my attemps to incorporate the Chrome location did not work.

@CYCho Seeing your post with the \\ , I felt so stupid 😁, at the moment I am in crisis mode@workbut I a going to test it out.
Thanks!

Posted

Hi, 

Im having problems with _WD_Download , im trying to dowload files from a portal , i need to login before reach this section :

74f506d7905118e56e61fce2c67dea3e.png

im able to extract the links of the " .pdf " files but when i use these url  in WD_Dowload i have this output on console :

code : _WD_DownloadFile("https://w201.mastercardconnect.com/hsm3ca267/homememb/library/shared/ENG/EMECR/EMECR_Manual.pdf",@ScriptDir & "\sepudo.pdf")

d7add5ca166c6f79fafb14376f29b01d.png

I think the dowload failed(it download a 3kb file that cant be opened as pdf, the size of these pdfs are 3Mb+) because this kind of url need a login before .i've tried to download a " public " pdf document and it works.  

pd : Im using wd_core v0.2.0.6 
pd2 : Sorry for my English , im from Peru 

 

 

Posted
41 minutes ago, ADream said:

Im using wd_core v0.2.0.6 

Why?! That's really old. Please switch to v0.3.0.9 and then report back.

Quote

I think the dowload failed(it download a 3kb file that cant be opened as pdf, the size of these pdfs are 3Mb+) because this kind of url need a login before .i've tried to download a " public " pdf document and it works

You may be correct. However, I know there were recent updates to _WD_DownloadFile. Also some changes in the latest unreleased version.

Posted
3 hours ago, Danp2 said:

Why?! That's really old. Please switch to v0.3.0.9 and then report back.

You may be correct. However, I know there were recent updates to _WD_DownloadFile. Also some changes in the latest unreleased version.

Hahahaha , i've tried to update but when i run my scripts , some functions dont behave as the do with  v0.3.0.9 , i'll update my scripts later 😔

Now im trying another aproach but in order to solve my problem... 

is there a way of enable this option in chromedriver with a line of code ? 

url : chrome://settings/content/pdfDocuments

08a72e440a2758d673a94a66595ad3b4.png

Posted
5 hours ago, Danp2 said:

@ADream Try using this --

Local $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "prefs": {"plugins.always_open_pdf_externally": true}}}}}'

 

Thank you so much for your help Danp2 !  

Posted

@Danp2

Hi! It's possible to add an option to the _Wd_Attach so the browser doesn't get focus when the script runs the _Wd_Attach? Sometimes i'm working in another thing while the script is running and it bothers, the need to always change the window after the script runs the _Wd_Attach.

Thanks!

Posted
3 hours ago, Danp2 said:

@pubeoutros I can't see anything in the code where I am forcibly changing the window focus, so I'm guessing the behavior that you are describing is a byproduct of whatever browser / webdriver combo you are using.

Have you considered running in "headless" mode, where the browser isn't visible at all?

Yes I tried the headless, but i use this to copy some tables and find some clients and add information, that way, and sometimes, i need the browser to be visible to copy some informations (to my phone, for example).

Ok, thanks anyway, it's only beacuse it bothers, I have my script to run every 30min or 1h and every time that the script runs, the _WD_Attach, the browser get focus. Nothing that i couldn't handle, but once again, it's boring and makes me losing my focus. I just thought that it could be done inside the _WD_Attach.

I need to search and do some tests to try to get what windows is active, before the _WD_Attach and after the Attach, get that windows active again.

Thanks!

Posted (edited)

 I would like the same option like pubeoutros.

inside _WD_Attach , I think it's happening specifically with the line:
  

 

_WD_Window($sSession, 'Switch', '{"handle":"' & $sHandle & '"}')

 

It's strange that it seems to popup chrome focus only every 2 times it's called. (I put some msgbox to find when it brings the chrome to focus)
i.e. first call to Attach it doesn't focus, but the Chrome icon on Taskbar becomes Orange, then at the next call of _WD_Attach/switch it brings the focus on chrome and the taskbar icon return to normal!


Me too can't use Chrome headless, so for me it's very disturbing...

If you have an idea to solve this it'll be great.

 

Maybe disabling that icon state notification in the taskbar, reminder of a program attention?

I found this: "Icons on the taskbar will flash orange when they "require attention", this also unhides the taskbar until you switch to the application.

The Taskbar programs sometimes glow orange and flash because they are active or they have some notification."

Edited by frank10
Posted (edited)

@Danp2 Hello mate, 

I wonder if it is possible using webdriver or something else to use that kind of code

_GUICtrlRichEdit_SetSel("", "", "")
_GUICtrlRichEdit_SetCharBkColor( "", "") 
_GUICtrlRichEdit_Deselect( "" )

In short, is it possible to attach a rich edit control from Google Chrome to AutoIt function ?

Edited 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 - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Posted
14 hours ago, caramen said:

is it possible to attach a rich edit control from Google Chrome to AutoIt function ?

This isn't something that I've tried, so I can't really answer your question. I imagine that it would be better to manipulate the control using javascript or by calling one of its native methods.

Can you provide an example website with the RTF control you want to access?

Posted (edited)

I have no example yet but I can find one... I mean I'm just thinking about the recent snippet I made and if this could be possible I could make a lot of powerfull things. 

I'm working with a lot of different ticket tools. And it would be cool to work inside the ticket behavior field. I have multiple ideas. 

 

let's take one of the AutoIT community friend ;) : https://regex101.com/

image.png.b3af20d7fc1324b5aa2e7b963cb691b2.png

 

Let's say I want to use the lines tagged above. With this input field. Is it possible ?

Actually the goal is to highlight things. But not Chrome elements. Text elements only. Everywhere depending on the regexp return values. 

image.png.396ecf4a7199ae881c9458492b4c790e.png

Edited 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 - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Posted (edited)

No look my last screen it demonstrate what I did into rich edit AutoIT control.

 

image.png.2ab62408624862e78fc8a775efd7268b.png

Would like to do same into a chrome input field. like the regex101 one.

Edited 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 - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Posted

Not a great example IMO since the regex101 website isn't using an RTF editor. Take a look at https://quilljs.com/playground/ for a better example.

1 hour ago, Danp2 said:

I imagine that it would be better to manipulate the control using javascript or by calling one of its native methods.

Still think this will be your best option when attempting to do this within a web browser.

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

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