저는 각도기를 처음 사용합니다.콘솔 로그에 로케이터 (webelement)를 인쇄 할 수 없습니다.
나는 같은 요소를 선언하고있어 변수 같은 : 내가 좋아하는 파일 사양에서이 함수를 호출하고있어
var clickOn = function(webElement)
{
webElement.click();
console.log("Successfully clicked on the " + webElement);
};
: 나는대로 로케이터를 기록하려면 어떤 점에서
txtSearch : element(by.xpath('//input[@type="search"]')),
- clickOn (txtSearch)
Console.log
나는 - Successfully clicked on the [object Object]
과 같이 나타납니다.
아래에 필요한 세부 사항을 검색 할 수 있습니다 :
노드 버전 : 7.5.0
각도기 버전 : 5.1.1
브라우저 (들) : 크롬
각도기를 구성 파일 :
exports.config = {
capabilities: {
browserName: 'chrome',
},
onPrepare: function(){
jasmine.getEnv().addReporter(reporter);
global.isAngularSite = function(flag) {
browser.ignoreSynchronization = !flag;
};
browser.manage().timeouts().setScriptTimeout(60000);
browser.driver.manage().window().maximize();
},
seleniumServerJar: '../../protractor/selenium/selenium-server-standalone-2.52.0.jar',
chromeDriver: '../../protractor/selenium/chromedriver_2.27.exe',
directConnect: true,
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['../PoC_Protractor/spec.js'],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 600000,
isVerbose: true
}
,
나는 webElement.locator().toString()
과 노력하지만 throwing-
실패 : webElement.locator 당신은 항상 출력 로케이터가
webElement.locator().toString()
를 사용하여 사용 할 수있는 기능
Pls는 체크 내 대답은 아래 .. toString() 작동해야합니다. 그 앞에서 시도한 내용으로 질문을 업데이트 할 수도 있습니다 – AdityaReddy
[Protractor 콘솔 로그]의 가능한 복제본 (http://stackoverflow.com/questions/19941739/protractor-console-log) – Xotabu4
[각도기에서 웹 요소를 인쇄하는 방법] 가능한 복제본 (http://stackoverflow.com)/questions/42267387/how-to-print-the-webelement-in-protractor) –