Jasmine useful methods

driver.findElement(By.xpath("//input[@id='gbqfq']")).sendKeys("some text");
driver.findElement(By.id("gbqfq")).sendKeys("some text");
describe('HealthSense POC Grid', function() {
         beforeEach(function() {
           browser.get('http://Your Application URL');
            ptor = protractor.getInstance();
           });
 
        it('should click on the grid link', function() {
               element(by.xpath('//a[contains(text(),"Grid")]')).click();
           expect(element(by.xpath('//h1')).getText()).toEqual('Master Grid');
           });
           
        it('should enter ID in filter', function() {
                   ptor.actions().sendKeys(protractor.Key.HOME).perform();
          element(by.model('Model.ID')).sendKeys('10');
          results = element.all(by.repeater('value in testValues'));
               expect(results.count()).toEqual(5);
           element(by.model('Model.ID')).clear();
          ptor.actions().sendKeys(protractor.Key.SPACE).perform();
        });
           
        it('should change the number of records per page to 10', function(){
           element(by.xpath('//select')).click();
            element(by.css('option[value="10"]')).click();
            results1 = element.all(by.repeater('value in testValues'));
          expect(results1.count()).toEqual(10);
        });
});
makeFord = protractor.By.xpath('//select[@id="make"]/option[text()="Ford"]'));
modelMustang = protractor.By.xpath('//select[@id="model"]/option[text()="Mustang"]'));
makeFord.click();
modelMustang.click();
ptor.findElement(protractor.By.xpath('//select/option[1]'));
protractor.By.xpath('//select/option[text()="Option 2"]'));


					
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s