I am currently in the process of writing functional test cases using the leadfoot intern framework. The specific test case I am working on involves entering text into a form field and clicking a button that triggers the opening of a bootstrap modal. My goal is to verify the display property of an element within this modal.
However, I am encountering an issue when trying to locate the element with the id 'viewBtn'. An error is thrown stating: NoSuchElement: [POST http://localhost:4444/wd/hub/session/e23a975b60188479d599d2 43505ce9cb/element/0.1521919297986265-4/element / {"using":"id","value":"viewBtn tBtn"}] no such element: Unable to locate element: {"method":"id","selector":"viewBtn "}
define(function (require){
var registerSuite = require('intern!object');
var assert = require('intern/chai!assert');
registerSuite({
name:'Test Page',
'Continue':function(){
return this.remote
.get(require.toUrl('http://sdfsdfs'))
.setFindTimeout(5000)
.findById('to')
.click()
.type('john')
.end()
.findById('from')
.click()
.type('man')
.end()
.findById('message')
.click()
.type('hello')
.end()
.findByCssSelector("[name=formName]").findByClassName('btn')
.click()
.end()
.setFindTimeout(5000)
.findById('viewBtn')
.isDisplayed()
.then(function(text){
assert.equal(text,'true','Not Displayed');
})
}
});
})
;
It's puzzling why the error is being triggered even though the specified id exists in the element. Additionally, I'm curious as to whether calling the end method after every find operation might be contributing to this issue?