...9import org.openqa.selenium.OutputType;10import org.openqa.selenium.Point;11import org.openqa.selenium.interactions.Interaction;12import org.openqa.selenium.interactions.Pause;13import org.openqa.selenium.interactions.PointerInput;14import org.openqa.selenium.interactions.PointerInput.Origin;15import org.openqa.selenium.interactions.Sequence;16import org.openqa.selenium.io.FileHandler;17import org.openqa.selenium.remote.CapabilityType;18import org.openqa.selenium.remote.DesiredCapabilities;19import org.openqa.selenium.support.ui.ExpectedConditions;20import org.openqa.selenium.support.ui.WebDriverWait;21import io.appium.java_client.MobileElement;22import io.appium.java_client.android.AndroidDriver;23public class MGUsingSeleniumDoubleTap 24{25 public static void main(String[] args) throws Exception26 {27 //Start appium server28 Runtime.getRuntime().exec("cmd.exe /c start cmd.exe /k \"appium -a 127.0.0.1 -p 4723\"");29 //Get address of appium Server30 URL u=new URL("http://127.0.0.1:4723/wd/hub");31 //Details of app and device(AVD)32 DesiredCapabilities dc=new DesiredCapabilities();33 dc.setCapability(CapabilityType.BROWSER_NAME,"");34 dc.setCapability("deviceName","ZY2243MMDP");35 dc.setCapability("platformName","android");36 dc.setCapability("platformVersion","8.1.0");37 dc.setCapability("appPackage","com.vodqareactnative");38 dc.setCapability("appActivity","com.vodqareactnative.MainActivity");39 //Create driver object40 AndroidDriver driver;41 while(2>1)42 {43 try44 {45 driver=new AndroidDriver(u,dc);46 break;47 }48 catch(Exception ex)49 {50 }51 }52 53 //Automation54 try55 {56 WebDriverWait wait=new WebDriverWait(driver,20);57 wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@text='LOG IN']"))).click();58 while(2>1)59 {60 try61 {62 wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@text='Double Tap']"))).click();63 break;64 65 }66 catch(Exception exe)67 {68 //Get device dimensions69 int width=driver.manage().window().getSize().getWidth();70 int height=driver.manage().window().getSize().getHeight();71 //Swipe logic72 PointerInput finger=new PointerInput(PointerInput.Kind.TOUCH,"finger");73 Sequence swipe=new Sequence(finger,1);74 Interaction i1=finger.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(),width/2,(int) (height*0.8));75 swipe.addAction(i1);76 Interaction i2=finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg());77 swipe.addAction(i2);78 Interaction i3=finger.createPointerMove(Duration.ofMillis(1000),PointerInput.Origin.viewport(),width/2,(int) (height*0.3)); 79 swipe.addAction(i3); 80 Interaction i4=finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg());81 swipe.addAction(i4);82 driver.perform(Arrays.asList(swipe));83 84 }85 }86 87 wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@text='Double Tap Me']")));88 MobileElement ele=(MobileElement) driver.findElement(By.xpath("//*[@text='Double Tap Me']"));89 Point source=ele.getCenter();90 PointerInput finger=new PointerInput(PointerInput.Kind.TOUCH,"finger");91 Sequence doubletap=new Sequence(finger,1);92 Interaction i1=finger.createPointerMove(Duration.ofMillis(0),PointerInput.Origin.viewport(), source.x, source.y);93 doubletap.addAction(i1);94 Interaction i2=finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg());95 doubletap.addAction(i2);96 Interaction i3=finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg());97 doubletap.addAction(i3);98 Pause i4=new Pause(finger, Duration.ofMillis(50));99 doubletap.addAction(i4);100 Interaction i5=finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg());101 doubletap.addAction(i5);102 Interaction i6=finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg());103 doubletap.addAction(i6);104 driver.perform(Arrays.asList(doubletap));105 106 //Validation107 try108 {109 wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@text='Double tap successful!']")));110 if(driver.findElement(By.xpath("//*[@text='Double tap successful!']")).isDisplayed())111 {112 System.out.println("Double tap test passed");113 driver.findElement(By.xpath("//*[@text='OK']")).click();114 }115 }116 catch(Exception exe)...