1

COUNTY HTMLmy action class to click looks like this:

var mail=element(by.xpath('//span[@class="mat-select-placeholder ng- tns- 
c44-174 ng-star-inserted"][text()="Country"]'));
browser.actions();

browser.actions.mouseMove(mail);
browser.actions.click().perform();
browser.sleep('3000');
var subMenu=element(by.xpath('//span[@class="mat-option-text"][text()="United States"]'));
subMenu.click();
browser.sleep('6000'); 

While executing throws:

Message: Failed: sequence is not defined Stack: ReferenceError: sequence is not defined

Any help is appreciated. Thanks

<span class="mat-select-placeholder ng-tns-c34-236 ng-star-inserted" style="">Country</span>  

United States us HTML html

kurva
  • 13
  • 5
  • If you drop one action after another, does it continue at some point? Can you also post a bit of that HTML? – LazioTibijczyk Oct 29 '18 at 16:00
  • @LazioTibijczyk yes.To select US ,First I need to click on Country.only after clicking I will see options and I need to click first one to select US – kurva Oct 29 '18 at 16:07
  • @LazioTibijczyk – kurva Oct 29 '18 at 16:08
  • I assume it's a select. Can you edit your post with your code and format it? You don't really specify what should be clicked. You should write something like: mail.click(); subMenu.click(); You don't have to type browser.actions... – LazioTibijczyk Oct 29 '18 at 16:10
  • @LazioTibijczyk I attacjhed HTML pics https://i.stack.imgur.com/71Xhc.png https://i.stack.imgur.com/h8Udt.png – kurva Oct 29 '18 at 16:24
  • @LazioTibijczyk I edit locators did not work for me var mail= element(by.xpath('//input[@placeholder="Country"]')); mail.click(); var subMenu= element(by.cssContainingText('.mat-option-text', 'United States ')); subMenu.click(); browser.sleep('3000'); browser.sleep('6000'); – kurva Oct 29 '18 at 16:29

1 Answers1

0

Can you try the following?

element(by.cssContainingText('span', 'Country')).click();
browser.sleep(3000);
element(by.cssContainingText('mat-option', 'United States')).click();
browser.sleep(6000); 
LazioTibijczyk
  • 1,701
  • 21
  • 48