In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
package com.appium.cases;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.ios.IOSElement;
import io.appium.java_client.remote.IOSMobileCapabilityType;
import io.appium.java_client.remote.MobileCapabilityType;
import java.io.File;
import java.net.URL;
public class IOSDeijtong {
IOSDriver driver;
//Command line startup
@BeforeClass
public void setUp() throws Exception {
File appDir = new File(System.getProperty("user.dir"));
final File app = new File(appDir, "/app/Toon.ipa");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName","IOS"); //mobile os
capabilities.setCapability("platformVersion", "11.0.3"); //OS version of phone to boot
capabilities.setCapability("deviceName", "iPhonexq"); //phone type or simulator type, e.g. MI_2A/Android Emulator/iPhone Simulator
capabilities.setCapability("udid","0259411d3508a459149c8aec521ff5845a2e835b"); //physical machine ID //Mac platform used a779c7953c50967fca89500e932981029e306659
capabilities.setCapability("useNewWDA",false); //false
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 3600);
//capabilities.setCapability (IOSMobileCapabilityType.AUTO_ACCEPT_ALERTS, true); //All IOS alerts appear with option ACCEPT
capabilities.setCapability("bundleId", "com.systoon.beijingtong");
capabilities.setCapability("app", app.getAbsolutePath()); //Get the absolute path of the app (a path under the project is enabled if installed, not started if not installed)
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
@Test
public void allinLogin() throws InterruptedException { //Login
/** Allow */
Thread.sleep(5000);
//System.out.println (driver.getPageSource()); //get element
//driver.findElement (By.name ("Allow")).click();
//Login Username XCUIElementTypeTextField
driver.findElementByName("Please enter mobile number").clear();
driver.findElementByName("Please enter the mobile phone number").sendKeys("1472500001");
//Password
driver.findElementByName("Please enter your password").sendKeys("1111");
//Login
driver.findElementByName("Login").click();
Thread.sleep(5000);
System.out.println("This is the login page");
System.out.println(driver.getPageSource()); //get element
//final WebElement text = river.findElement(By.xpath("//UIATextField[1]"));
}
@AfterClass
public void tearDown() throws Exception {
// driver.quit();
}
}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.