File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -877,7 +877,29 @@ def get_remote_driver(
877
877
device_pixel_ratio ,
878
878
):
879
879
downloads_path = download_helper .get_downloads_folder ()
880
- address = "%s://%s:%s/wd/hub" % (protocol , servername , port )
880
+ if servername .startswith ("https://" ):
881
+ protocol = "https"
882
+ servername = servername .split ("https://" )[1 ]
883
+ elif "://" in servername :
884
+ servername = servername .split ("://" )[1 ]
885
+ server_with_port = ""
886
+ if ":" not in servername :
887
+ col_port = ":" + str (port )
888
+ first_slash = servername .find ("/" )
889
+ if first_slash != - 1 :
890
+ server_with_port = (
891
+ servername [:first_slash ] + col_port + servername [first_slash :]
892
+ )
893
+ else :
894
+ server_with_port = servername + col_port
895
+ else :
896
+ server_with_port = servername
897
+ address = "%s://%s" % (protocol , server_with_port )
898
+ if not address .endswith ("/wd/hub" ):
899
+ if address .endswith ("/" ):
900
+ address += "wd/hub"
901
+ else :
902
+ address += "/wd/hub"
881
903
desired_caps = {}
882
904
extra_caps = {}
883
905
if cap_file :
You can’t perform that action at this time.
0 commit comments