我正在执行以下测试以验证屏幕上的文本,文本显示在视图上,但需要页面滚动以手动查看文本.
onView(withText("Launch")).check(ViewAssertions.matches(isDisplayed()));
onView(withText("January 2010")).check(ViewAssertions.matches(isDisplayed()));
Run Code Online (Sandbox Code Playgroud)
出现以下错误,但文本出现在视图中,但需要页面滚动才能手动查看文本.
android.support.test.espresso.base.DefaultFailureHandler $ AssertionFailedWithCauseError:'在屏幕上显示给用户'与所选视图不匹配.预期:在屏幕上显示给用户Got:"TextView {id = 2131361941,res-name = project_details_label_tv,visibility = VISIBLE,width = 249,height = 41,has-focus = false,has-focusable = false,has -window-focus = true,is-clickable = false,is-enabled = true,is-focused = false,is-focusable = false,is-layout-requested = false,is-selected = false,root-is-layout -requested = false,has-input-connection = false,x = 4.0,y = 24.0,text = Status,input-type = 0,ime-target = false,has-links = false}"
错误:任务':app:prepareDebugAndroidTestDependencies'的执行失败.
依赖性错误.请参阅控制台了解详情
在app.gradle文件中添加以下依赖项后 -
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
// add this for intent mocking support
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
// add this for webview testing support
androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2.2'
Run Code Online (Sandbox Code Playgroud)
控制台日志 -
信息:Gradle任务[:app:clean,:app:generateDebugSources,:app:mockableAndroidJar,:app:prepareDebugUnitTestDependencies,:app:generateDebugAndroidTestSources,:app:assembleDebug]警告:与依赖项冲突'com.android.support:support-annotations ".app(25.0.0)和测试app(23.1.1)的已解决版本有所不同.有关详细信息,请参阅http://g.co/androidstudio/app-test-app-conflict.错误:任务':app:prepareDebugAndroidTestDependencies'的执行失败.
依赖性错误.请参阅控制台了解详情 信息:BUILD FAILED信息:总时间:28.459秒信息:1错误信息:1警告信息:在控制台中查看完整输出
android gradle build.gradle android-gradle-plugin android-espresso
我正在尝试使用 python 和 selenium 自动化我的 Web 应用程序,我面临以下问题。
环境 - Mac/Python/Selenium IDE - PyCharm
selenium.common.exceptions.WebDriverException: 消息:'chromedriver' 可执行文件需要在 PATH 中。请参阅 https://sites.google.com/a/chromium.org/chromedriver/home
请帮我解决这个问题。
我从 API 调用获取 XML 响应。
我需要此响应中的“testId”属性值。请帮我解决这个问题。
r = requests.get( myconfig.URL_webpagetest + "?url=" + testurl + "&f=xml&k=" + myconfig.apikey_webpagetest )
xmltxt = r.content
print(xmltxt)
testId = XML(xmltxt).find("testId").text
r = requests.get("http://www.webpagetest.org/testStatus.php?f=xml&test=" + testId )
Run Code Online (Sandbox Code Playgroud)
xml响应:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<statusCode>200</statusCode>
<statusText>Ok</statusText>
<data>
<testId>180523_YM_054fd7d84fd4ea7aed237f87289e0c7c</testId>
<ownerKey>dfc65d98de13c4770e528ef5b65e9629a52595e9</ownerKey>
<jsonUrl>http://www.webpagetest.org/jsonResult.php?test=180523_YM_054fd7d84fd4ea7aed237f87289e0c7c</jsonUrl>
</data>
</response>
Run Code Online (Sandbox Code Playgroud)
产生以下错误:
Traceback (most recent call last):
File "/pagePerformance.py", line 52, in <module>
testId = XML (xmltxt).find("testId").text
AttributeError: 'NoneType' object has no attribute 'text'
Run Code Online (Sandbox Code Playgroud) 更新brew时遇到以下超时错误。
bhupendra@Bhupendras-MBP mobile-app % brew update
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3]: errno=Operation timed out
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3]: errno=Operation timed out
Error: Fetching /usr/local/Homebrew failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
Run Code Online (Sandbox Code Playgroud)
如果有人有解决方案,请帮忙。