File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 1717// </copyright>
1818
1919using System ;
20+ using System . Collections . Generic ;
2021
2122namespace OpenQA . Selenium
2223{
@@ -58,7 +59,17 @@ public void Forward()
5859 /// <param name="url">String of where you want the browser to go to</param>
5960 public void GoToUrl ( string url )
6061 {
61- this . driver . Url = url ;
62+ if ( url == null )
63+ {
64+ throw new ArgumentNullException ( nameof ( url ) , "URL cannot be null." ) ;
65+ }
66+
67+ Dictionary < string , object > parameters = new Dictionary < string , object >
68+ {
69+ { "url" , url }
70+ } ;
71+ this . driver . InternalExecute ( DriverCommand . Get , parameters ) ;
72+
6273 }
6374
6475 /// <summary>
@@ -72,7 +83,7 @@ public void GoToUrl(Uri url)
7283 throw new ArgumentNullException ( nameof ( url ) , "URL cannot be null." ) ;
7384 }
7485
75- this . driver . Url = url . ToString ( ) ;
86+ this . GoToUrl ( url . ToString ( ) ) ;
7687 }
7788
7889 /// <summary>
Original file line number Diff line number Diff line change @@ -109,17 +109,7 @@ public string Url
109109 return commandResponse . Value . ToString ( ) ;
110110 }
111111
112- set
113- {
114- if ( value == null )
115- {
116- throw new ArgumentNullException ( nameof ( value ) , "Argument 'url' cannot be null." ) ;
117- }
118-
119- Dictionary < string , object > parameters = new Dictionary < string , object > ( ) ;
120- parameters . Add ( "url" , value ) ;
121- this . Execute ( DriverCommand . Get , parameters ) ;
122- }
112+ set => new Navigator ( this ) . GoToUrl ( value ) ;
123113 }
124114
125115 /// <summary>
You can’t perform that action at this time.
0 commit comments