当我尝试在 mac 上打开 appium 时,出现错误 \xe2\x80\x9cAppium\xe2\x80\x9d can\xe2\x80\x99t 无法打开,因为 Apple 无法检查它是否存在恶意软件。
\nautomation appium android-studio appium-android appium-desktop
我正在测试iOS应用程序,登录后无法与元素交互,因为Appium过快.
有人可以指点一个使用WebDriverWait样式等待Appium iOS测试的例子吗?最好是在Ruby中.
谢谢.
我试图在Android设备上自动化Android Chrome浏览器(不只是webview或其他浏览器,而是Chrome浏览器).我认为这可以通过以下链接https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android来实现,但它会自动化我的pc chrome浏览器.
我也试过Appium,但日志后没有任何反应:
debug: executing: adb install C:\Users\hidden\Downloads\AppiumForWindows-0.14.2\
Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk
Run Code Online (Sandbox Code Playgroud)
当我尝试从浏览器访问信息时,我得到了这个:
info: Responding to client with error: {"status":13,"value":{"message":"An unkno
wn server-side error occurred while processing the command.","origValue":"Did no
t successfully proxy server command"},"sessionId":"666c9e4f-7653-487a-b299-959d4
000ca79"}
Run Code Online (Sandbox Code Playgroud)
我的环境变量PATH中有chromedriver.exe,整个日志如下所示:
info: Welcome to Appium v0.14.2
info: Appium REST http interface listener started on 127.0.0.1:5555
info - socket.io started
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"platform":"ANDROID
","app":"chrome","browserName":"android","browserConnectionEnabled":true,"app-pa
ckage":"com.android.chrome","device":"android","rotatable":true,"app-activity":"
com.google.android.apps.chrome.Main","takesScreenshot":true,"version":""}}
info: Looks like we want chrome on android
info: Creating …
Run Code Online (Sandbox Code Playgroud) 我有一个使用Ionic框架的混合应用程序构建,并希望使用量角器在模拟器上进行测试.如何设置使用量角器在模拟器上运行测试?
这是我到目前为止所尝试的:
1)我的所有测试都在浏览器中运行良好.
2)安装Appium(http://appium.io/)
3)修改了我的protractor.config.js文件:
exports.config = {
seleniumAddress: 'http://localhost:4723/wd/hub',
specs: [
'e2e/*_spec.coffee'
],
capabilities: {
browserName: '',
'appium-version': '1.3',
platformName: 'iOS',
platform: 'Mac',
platformVersion: '8.2',
deviceName: 'iPhone 5s',
app: 'absolute_path/platforms/ios/build/emulator/taco.app'
},
baseUrl: 'http://localhost:8100',
};
Run Code Online (Sandbox Code Playgroud)
这将启动模拟器,但不会运行测试.这是一个示例规范......
describe 'Taco', ->
describe 'Login', ->
beforeEach ->
browser.get('http://localhost:8100')
browser.executeScript('window.localStorage.clear();')
browser.waitForAngular()
it 'should login with valid credentials', ->
expect(element(By.css('.home-template')).isPresent()).toBe(true)
element(By.linkText('I have an account')).click()
element(By.model('credentials.email')).sendKeys('taco1@taco.com')
Run Code Online (Sandbox Code Playgroud) selenium hybrid-mobile-app appium protractor ionic-framework
我们正在构建混合原生应用程序(Cordova/Phonegap/Angular/Ionic).
我在Protractor中编写端到端测试.当在本地运行时,它们针对由Ionic模拟器(离子服务器)服务的应用程序执行.这很好用.
我还想在Sauce Labs(Appium)托管的平台模拟器上对"打包/构建"应用程序运行相同的测试.这几乎可行.
我现在遇到的麻烦是导航到应用程序.在本地运行时,在测试开始时我将导航到由ionic托管的应用程序:
browser.get('http://localhost:8100')
Run Code Online (Sandbox Code Playgroud)
这显然不适用于运行混合原生应用程序的模拟器.我在测试启动时检查了浏览器的当前Url,它是:
file:///android_asset/www/index.html#/login
Run Code Online (Sandbox Code Playgroud)
这是有道理的,也是正确的.但如果我试着:
browser.get('file:///android_asset/www/index.html#/login')
Run Code Online (Sandbox Code Playgroud)
坏事发生了.
我正在寻找两种解决方案之一:
1)了解如何导航到Urls以获取在模拟器中运行的混合本机应用程序
要么
2)以某种方式让测试知道它在混合原生cordova容器中运行并跳过导航到起始页面(因为应用程序由appium自动加载).
谢谢.
有没有人知道如何通过appium python客户端缩放android中的元素?
我目前正在使用
self.driver.zoom(self.element, percent)
但这会给出错误
self.driver.zoom(self.element, percent)
File "/usr/local/lib/python2.7/site-packages/appium/webdriver/webdriver.py", line 308, in zoom
self.execute_script('mobile: pinchOpen', opts)
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 461, in execute_script
{'script': script, 'args':converted_args})['value']
File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 233, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/site-packages/appium/webdriver/errorhandler.py", line 29, in check_response
raise wde
WebDriverException: Message: Method has not yet been implemented
Run Code Online (Sandbox Code Playgroud)
我也试过了MultiAction
.
loc = self.element.location
print loc
xx, yy = loc["x"], loc["y"]
xx=700
action1 = TouchAction(self.driver)
action1.long_press(x=xx, y=yy).move_to(x=0, y=1000).release()
action2 = TouchAction(self.driver)
action2.long_press(x=xx, y=yy).move_to(x=0, y=-1000).release()
m_action = MultiAction(self.driver)
m_action.add(action1, action2) …
Run Code Online (Sandbox Code Playgroud) 我正在测试一个应用程序,在大多数屏幕上,我看到有些元素具有相同的类"android.widget.TextView",索引号为"0".所有其他属性也相同,只有例外是"文本"和"绑定".
我将"跳过","下一步"和"跳过下一个3"作为屏幕上的文本,其具有除文本和边界属性之外的相同属性.我需要知道如何点appium点击所需的项目..说我想点击"下一步",我该怎么做.我正在使用Python进行脚本编写.
我在执行特定EditText
字段中的发送密钥时遇到问题。我尝试了一个肮脏的xpath和id,但是它仍然没有输入文本字段。但是我觉得找到元素没有问题。但是,它不会单击到元素中。
因此,应用程序中发生的事情是,当用户选择页面时,它会打开一个Web视图,并且该EditText
字段位于其中WebView
。
这是我从鸦片检查员那里得到的肮脏的xpath:
/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup/android.support.v4.view.ViewPager/android.view.ViewGroup/android.widget.EditText[1]
Run Code Online (Sandbox Code Playgroud)
这是不错的ID:
@FindBy(id = "test_number")
public WebElement testNumberTextField;
Run Code Online (Sandbox Code Playgroud)
我也尝试使用肮脏的xpath通过xpath使用find。
这是我尝试输入文本的方法。通过注释的代码,您可以看到我也尝试了其他方法来使其正常运行,但仍然没有成功:
public void enterTestNumber(){
//List<WebElement> menu22 =drive.getDriver().findElements(By.className("android.widget.EditText"));
// menu22.get(1).sendKeys(randomStringGeneratorMethods.randomAlphaNumericString(7));
testPage.testNumberTextField.sendKeys(randomStringGeneratorMethods.randomAlphaNumericString(7));
//js.executeScript("document.getElementById('"+testPage.testNumberTextField+").value='"+randomStringGeneratorMethods.randomAlphaNumericString(7)+"';");
}
Run Code Online (Sandbox Code Playgroud)
随机生成器只是一个随机字符串生成器,它是:
public String randomAlphaNumericString(int characterLength) {
return RandomStringUtils.randomAlphanumeric(characterLength);
}
Run Code Online (Sandbox Code Playgroud)
有谁知道如何使它工作,以便可以在此EditText
字段中键入文本?
当我尝试使用安装 appium 时 npm install -g appium
我收到消息
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/appium/node_modules/.bin/authorize-ios
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/appium/node_modules/.bin/authorize-ios'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
Run Code Online (Sandbox Code Playgroud)
如果我再次运行安装,我会得到
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/appium/build/lib/main.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod …
Run Code Online (Sandbox Code Playgroud) appium ×10
android ×4
selenium ×3
ios ×2
protractor ×2
python ×2
angularjs ×1
appium-ios ×1
automation ×1
cordova ×1
ionic ×1
java ×1
macos ×1
node.js ×1
npm-install ×1
ruby ×1
zoom ×1