嗨,我在使用基本量角器测试时遇到一些麻烦.
我的设置:
量角器conf.json:
"use strict";
exports.config = {
specs: '../E2ETests/**/*.js',
chromeOnly: true,
getPageTimeout: 30000,
allScriptsTimeout: 30000
}
Run Code Online (Sandbox Code Playgroud)考试:
"use strict";
describe('When clicking should add stuff', function () {
var ptor;
beforeEach(function () {
browser.get('https://localhost/myApp');
ptor = protractor.getInstance();
});
it('add stuff', function () {
// If I comment this, the test pass.
element(by.id('add-stuff-button')).click();
// This does not matter fails on the line above..
expect(browser.getTitle()).toBeDefined();
});
});
Run Code Online (Sandbox Code Playgroud)
错误:
UnknownError: unknown error: Element is not clickable at point (720, 881). …Run Code Online (Sandbox Code Playgroud) 当我尝试从我的Android应用程序上传图像或更大的文件时,它会崩溃并出现OutOfMemoryException.我想知道是否有其他方法可以做到这一点.
我在两个不同的地方崩溃了应用程序:
Base64.encodeToString(bytes, Base64.DEFAULT);
Run Code Online (Sandbox Code Playgroud)
这里base64字符串是nameValuPairs集合中的值之一.
HttpClient client = new DefaultHttpClient();
HttpPost httppost = new HttpPost(uo.WebServiceURL);
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(nameValuePairs); // On this line
httppost.setEntity(entity);
HttpResponse response = client.execute(httppost);
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我正在构建一个像这样的对象数组:
var postData = [];
$.each(selectedFields, function (index, value) {
var testTitle = 'testing ' + index;
postData.push({title: testTitle, title2 : testTitle});
}
Run Code Online (Sandbox Code Playgroud)
我然后发布它(注意我已经尝试了许多不同的aproaches):
$.post('SaveTitlesHandler.ashx', { form : postData }, function (data) {
console.log(data);
});
Run Code Online (Sandbox Code Playgroud)
然后我尝试在处理程序中获取数据...
public class SaveTitlesHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
string json = context.Request.Form.ToString();
}
}
Run Code Online (Sandbox Code Playgroud)
我似乎无法从请求中得到适当的json.有人有任何想法吗?
干杯.
TWD
android ×1
angularjs ×1
http-post ×1
ihttphandler ×1
javascript ×1
jquery ×1
json ×1
memory ×1
post ×1
protractor ×1