我正在尝试在移动模拟器(Safari 浏览器)上运行一些测试并遇到问题。切换到 iframe 后,我无法执行任何操作。
已经有一个已解决的问题,但是在通过这个线程后我没有找到任何解决方案。
https://github.com/appium/appium/issues/5832
导致问题的代码
public PaymentPage fillCreditCardInformation(String cardNumber, String expiryDate, String cvv, String postal ){
switchToPaymentFrame();
WebElement cardNumberEditbox = driver.findElement(By.name("cardnumber"));
}
private void switchToPaymentFrame() {
WebElement frame = driver.findElement(By.name("__privateStripeFrame3"));
driver.switchTo().frame(frame);
}
使用的模拟器:Iphone 6s、iPad Mini Webdriver 版本:3.4.0 Safari 驱动程序:2.48
堆栈跟踪:
org.openqa.selenium.WebDriverException: undefined is not an object (evalating 'a.querySelectorAll') (WARNING: the server does not provide any stacktrace information) Command duration or timeout: 30.48 seconds Build info: version: '3.4.0' ,修订:'未知',时间:'未知'系统信息:主机:'DL0019',ip:'127.0.1.1',os.name:'Linux',os.arch:'amd64',os.version:' 4.4.0-96-generic', java.version: '1.8.0_131' 驱动信息: org.openqa.selenium.remote.RemoteWebDriver Capabilities [{noReset=true, safari=true, browserstack.tunnelIdentifier=, browserstack.asyncStop=是的,语言=Apache-HttpClient/4.5.3 (Java/1.8.0_131),browserstack.selenium_version=3.4.0,deviceName==iPad Retina (9.1) [556DF534-C4AE-48B6-8ED3-BAF86198074A],平台=MAC ,browserstack.video.disableWaterMark=true, desired={noReset=true, browserstack.tunnelIdentifier=, browserstack.asyncStop=true, language=Apache-HttpClient/4.5.3 (Java/1.8.0_131), browserstack.selenium_version=3.4.0 , deviceName==iPad Retina (9.1) [556DF534-C4AE-48B6-8ED3-BAF86198074A], platform=MAC, browserstack.video.disableWaterMark=true, acceptSslCerts=false, newCommandTimeout=300.0, browser=ipad, platformVersion=9.1, acceptSslCert =false, browserName=safari, platformName=iOS, 64bit=false, browserstack.debug=true,orientation=portrait, browserstack.ie.noFlash=false, os_version=, mobile={"browser":"tablet","version" :"iPad Mini 4-9.1"}, browserstack.geckodriver=0.16.0, version=, browserstack.video=true, safariIgnoreFraudWarning=true, orig_os=macelc, realMobile=false,deviceOrientation=PORTRAIT,device=iPad Retina,proxy_type=node},acceptSslCerts=false,newCommandTimeout=300.0,browser=ipad,platformVersion=9.1,webStorageEnabled=false,acceptSslCert=false,browserName=safari,takeScreenshot=true,javascriptEnabled=true, platformName=iOS,64bit=false,browserstack.debug=true,networkConnectionEnabled=false,orientation=portrait,browserstack.ie.noFlash=false,warnings={},os_version=,mobile={"browser":"tablet","版本":"iPad Mini 4-9.1"}, browserstack.geckodriver=0.16.0, databaseEnabled=false, version=, browserstack.video=true, safariIgnoreFraudWarning=true, orig_os=macelc, realMobile=false, locationContextEnabled=false, deviceOrientation =PORTRAIT, device=iPad Retina, proxy_type=node}] 会话 ID:6bf643515813d0ccbe5fe75300ac2d8ea15a5960 *** 元素信息:{Using=name, value=cardnumber}