2020import com .google .common .collect .ImmutableMap ;
2121
2222import org .openqa .selenium .WebElement ;
23- import org .openqa .selenium .remote . RemoteWebElement ;
23+ import org .openqa .selenium .internal . HasIdentity ;
2424
2525
2626/**
@@ -50,7 +50,7 @@ public TouchAction(MobileDriver driver) {
5050 * @return this TouchAction, for chaining.
5151 */
5252 public TouchAction press (WebElement el ) {
53- ActionParameter action = new ActionParameter ("press" , (RemoteWebElement ) el );
53+ ActionParameter action = new ActionParameter ("press" , (HasIdentity ) el );
5454 parameterBuilder .add (action );
5555 return this ;
5656 }
@@ -79,7 +79,7 @@ public TouchAction press(int x, int y) {
7979 * @return this TouchAction, for chaining.
8080 */
8181 public TouchAction press (WebElement el , int x , int y ) {
82- ActionParameter action = new ActionParameter ("press" , (RemoteWebElement ) el );
82+ ActionParameter action = new ActionParameter ("press" , (HasIdentity ) el );
8383 action .addParameter ("x" , x );
8484 action .addParameter ("y" , y );
8585 parameterBuilder .add (action );
@@ -104,7 +104,7 @@ public TouchAction release() {
104104 * @return this TouchAction, for chaining.
105105 */
106106 public TouchAction moveTo (WebElement el ) {
107- ActionParameter action = new ActionParameter ("moveTo" , (RemoteWebElement ) el );
107+ ActionParameter action = new ActionParameter ("moveTo" , (HasIdentity ) el );
108108 parameterBuilder .add (action );
109109 return this ;
110110 }
@@ -135,7 +135,7 @@ public TouchAction moveTo(int x, int y) {
135135 * @return this TouchAction, for chaining.
136136 */
137137 public TouchAction moveTo (WebElement el , int x , int y ) {
138- ActionParameter action = new ActionParameter ("moveTo" , (RemoteWebElement ) el );
138+ ActionParameter action = new ActionParameter ("moveTo" , (HasIdentity ) el );
139139 action .addParameter ("x" , x );
140140 action .addParameter ("y" , y );
141141 parameterBuilder .add (action );
@@ -149,7 +149,7 @@ public TouchAction moveTo(WebElement el, int x, int y) {
149149 * @return this TouchAction, for chaining.
150150 */
151151 public TouchAction tap (WebElement el ) {
152- ActionParameter action = new ActionParameter ("tap" , (RemoteWebElement ) el );
152+ ActionParameter action = new ActionParameter ("tap" , (HasIdentity ) el );
153153 parameterBuilder .add (action );
154154 return this ;
155155 }
@@ -178,7 +178,7 @@ public TouchAction tap(int x, int y) {
178178 * @return this TouchAction, for chaining.
179179 */
180180 public TouchAction tap (WebElement el , int x , int y ) {
181- ActionParameter action = new ActionParameter ("tap" , (RemoteWebElement ) el );
181+ ActionParameter action = new ActionParameter ("tap" , (HasIdentity ) el );
182182 action .addParameter ("x" , x );
183183 action .addParameter ("y" , y );
184184 parameterBuilder .add (action );
@@ -216,7 +216,7 @@ public TouchAction waitAction(int ms) {
216216 * @return this TouchAction, for chaining.
217217 */
218218 public TouchAction longPress (WebElement el ) {
219- ActionParameter action = new ActionParameter ("longPress" , (RemoteWebElement ) el );
219+ ActionParameter action = new ActionParameter ("longPress" , (HasIdentity ) el );
220220 parameterBuilder .add (action );
221221 return this ;
222222 }
@@ -229,7 +229,7 @@ public TouchAction longPress(WebElement el) {
229229 * @return this TouchAction, for chaining.
230230 */
231231 public TouchAction longPress (WebElement el , int duration ) {
232- ActionParameter action = new ActionParameter ("longPress" , (RemoteWebElement ) el );
232+ ActionParameter action = new ActionParameter ("longPress" , (HasIdentity ) el );
233233 action .addParameter ("duration" , duration );
234234 parameterBuilder .add (action );
235235 return this ;
@@ -279,7 +279,7 @@ public TouchAction longPress(int x, int y, int duration) {
279279 * @return this TouchAction, for chaining.
280280 */
281281 public TouchAction longPress (WebElement el , int x , int y ) {
282- ActionParameter action = new ActionParameter ("longPress" , (RemoteWebElement ) el );
282+ ActionParameter action = new ActionParameter ("longPress" , (HasIdentity ) el );
283283 action .addParameter ("x" , x );
284284 action .addParameter ("y" , y );
285285 parameterBuilder .add (action );
@@ -297,7 +297,7 @@ public TouchAction longPress(WebElement el, int x, int y) {
297297 * @return this TouchAction, for chaining.
298298 */
299299 public TouchAction longPress (WebElement el , int x , int y , int duration ) {
300- ActionParameter action = new ActionParameter ("longPress" , (RemoteWebElement ) el );
300+ ActionParameter action = new ActionParameter ("longPress" , (HasIdentity ) el );
301301 action .addParameter ("x" , x );
302302 action .addParameter ("y" , y );
303303 action .addParameter ("duration" , duration );
@@ -355,7 +355,7 @@ public ActionParameter(String actionName) {
355355 optionsBuilder = ImmutableMap .builder ();
356356 }
357357
358- public ActionParameter (String actionName , RemoteWebElement el ) {
358+ public ActionParameter (String actionName , HasIdentity el ) {
359359 this .actionName = actionName ;
360360 optionsBuilder = ImmutableMap .builder ();
361361 addParameter ("element" , el .getId ());
0 commit comments