last day (15 days later) » 

7:33 PM
1
A: Bypass "External protocol request" popup during selenium automation

StanjerYou have 2 possible options. 1) Is running a chrome with a predefined profile, where you have disabled protocol handling manually (via interface or config file) ("Local State" file in profile settings, you should add "waze": false in the appropriate section, you can search for "mailto" to know w...

 
1) a) how can I remote webdriver to use specific chrome settings or profile? 1) b) is it also for mac? 2) will it just work without settings change if i just switch to FF?
 
1) a - via ChromeOptions, how is it - depends on your framework. In java ChromeOptions options = new ChromeOptions(); options.addArguments("user-data-dir="+userProfile); WebDriver driver = new ChromeDriver(options); 1) b - sure . 2) for ff it should be another option
 
is there a way to suppress it to all profiles? meaning by default no application will handle this protocol, unless specific profile configures explicitly?
 
As Iknow - there is no.
 
can you please help me locate this file? I couldn't reach it "Local State" file in profile settings
 
7:33 PM
~/Library/Application Support/Google/Chrome
 
Thanks, but where does it shows which chrome profile this relates to? or is it for all profiles?
i added: "waze":false,"mailto":false, and yet the popup appears. The webdriver opens an anonymous chrome profile
 
but are you starting chrome with that profile?
 
two things: (1) in Local stat i don't see it's related to any profile. is it for all profiles? (2) my webdriver uses anonymous chrome- so how can i affect this?
 
I have tried it and it works. Have you also tried 2nd variant?
 
7:34 PM
hey
 
first, thanks for all the help!
 
yeah :) So, can you explain one more time
what you have did
and what is wrong
 
can you please help me with these two q?

(1) in Local stat i don't see it's related to any profile. is it for all profiles?
(2) my webdriver uses anonymous chrome- so how can i affect this?
i don't want to use the 2nd varient because it will prolong my test tremendously. every test opens a new anonymous chrome. and I'll have to redefine it over and over again
 
hm, i'm not so sure for os x, but I think if you are not specifing the exact profile - it is
one thing is, please copy profile folder to another one, and run it using not default profile path
you can test it first manually, without selenium by opening as is
google-chrome --profile-directory=/path/to/profile
and then try to do it manually first, if it doesnt appear
 
not sure I follow
 
7:41 PM
Maybe at first, just create a separate profile for your test
with something like everythingsysadmin.com/2010/09/… or just make it inside chrome
 
I'll try

btw, when you write:
please copy profile folder to another one, and run it using not default profile path
 
I meant to make a separate profile for test, for not to spoil it with general surfing etc
you can create a clean one, that's will be better
 
and then?

how do i call it from selenium?
 
something like
String userProfile= "C:\\Users\\user_name\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\";
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir="+userProfile);
WebDriver driver = new ChromeDriver(options);
depends on what are u using
 
or even first: how will i define the "waze":false in the handlers ? as the handlers seems to be for all profiles
 
7:46 PM
nope. So, you are creating a new profile (with all it's own settings)
 
"profiles_created":7},"promo":{"ntp_notification_promo":[{"closed":true,"end":0.‌​0,"group":0,"increment":1,"increment_frequency":0,"increment_max":0,"max_views":0‌​,"num_groups":100,"segment":0,"start":0.0,"text":"","views":0}]},"protocol_handle‌​r":{"excluded_schemes":{"afp":true,"data":true,"disk":true,"disks":true,"file":tr‌​ue,"hcp":true,"javascript":true,"waze”:true,”mailto":false,"ms-help":true,"news":‌​false,"nntp":true,"shell":t
 
and then openins it from a test
 
"with all it's own settings"
that's the thinkg I don't know how to set for this specifically "waze" = false
only via ui. and that's what i'll do
 
you can set it even manually, by pressing do nothing in UI
and after that it will be added to the settings
Have you tried?
and keep "REmember settings" ticked
after that try if it became turned off or not
 
ahhh i see
i'll try later. but thanks for all the help
 
7:49 PM
yeah sure, ask if u'll need.
one more thing
you can give a try for it (i dont know if it works)
I mean it should work, but you should spend an houyr or two implementing it
you can try to do it via autoit integration to your project
depending on what yr language is
 
חשהש
java
 
if you are using java - you are lucky
then there are tons of tutorials
something like this one
just integrate it to your project and it can click any modal and non-modal windows
but as i told, spend an hour or two integrating it
 
of implementing what? i not sure i follow
 
"autoit"
 
for what?
 
7:54 PM
for clicking "no" inside the popup
it can easily catch it
ok, i should go in fact :)
hope youll find how to do it
 
thanks
just last q
"String userProfile= "C:\\Users\\user_name\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\"; "
how can it lead me to a specific profile? after all it says "default"
 

last day (15 days later) »