Reputation: 1
I have set up my jasmine framework using the steps mentioned here, but when I try to use jasmine keywords like browser.open
to open a URL in the Browser I get an error browser not defined
. When I use require
to get another page, it gives Reference error: module not found
.
Also, with my jasmine package, I did not get the specRunner.html
.
I have tried installing protractor also and different approaches, but it's not working.
I need to set up jasmine framework for UI automation, can anyone help me with the exact set up and issues that I am facing right now?
Upvotes: 0
Views: 78
Reputation: 28757
The jasmine library is not related to browser automation. It is a library about testing. It does not define the browser
object. I'm not sure which library you expect to require. Perhaps you want to use Selenium. In particular, you will want to look at the WebDriver API.
It allows you to do things like this:
var driver = new webdriver.Builder().build();
driver.get('http://www.google.com');
var element = driver.findElement(webdriver.By.name('q'));
element.sendKeys('Cheese!');
element.submit();
driver.getTitle().then(function(title) {
console.log('Page title is: ' + title);
});
driver.wait(function() {
return driver.getTitle().then(function(title) {
return title.toLowerCase().lastIndexOf('cheese!', 0) === 0;
});
}, 3000);
driver.getTitle().then(function(title) {
console.log('Page title is: ' + title);
});
driver.quit();
Upvotes: 0