Emna Ayadi
Emna Ayadi

Reputation: 2460

Element could not be located in protractor scripts using appium

I want to automate my tests for an Angular JS site using Ipad Air simulator, appium and protractor but the problem that the test couldn't be passed successfully, it tells me that element couldn't be located and i'm sure about the xpath it's the same generated by appium.

This is my config file

​exports.config = {
  allScriptsTimeout: 600000,
  seleniumAddress: 'http://0.0.0.0:4723/wd/hub',

  specs: [
    'testsuite/test3.js'
  ],

  capabilities: {
    browserName: 'safari',
   'appium-version': '1.4.13',
    platformName: 'iOS',
    platformVersion: '9.3',
    deviceName: 'iPad Air'
},

  chromeOnly: false,

  baseUrl: 'http://urlofmyapp',

  frameworks:[
    'jasmine'
  ],

mochaOpts: { 

    defaultTimeoutInterval:1000000
}         
}; 

My test3.js file contain :

"use strict";
var wd = require("wd");
var chai = require("chai");
var chaiAsPromised = require("chai-as-promised");

chai.use(chaiAsPromised);

var expect = chai.expect;

chai.should();
chaiAsPromised.transferPromiseness = wd.transferPromiseness;

describe('my app', function() {

it('should make the login test',function()  {

var desired = {
browserName: 'safari',
platformName:'iOS',
name:"This is an example for login test"
}
browser.ignoresynchronization=true;
browser.get("theurlofmyapp");


 browser.driver.findElement(by.xpath("//UIAApplication[1]/UIAWindow[2]/UIAScrollView[1]/UIAScrollView[1]/UIAWebView[1]/UIATextField[1]")).sendKeys("RET02");


});

});

Here the error while running

protractor protractor.config.js

Protractor Error

Upvotes: 0

Views: 165

Answers (1)

KCaradonna
KCaradonna

Reputation: 770

Change browser.driver.findElement to browser.findElement

Upvotes: 1

Related Questions