-2

[![This image shows html code ][1]][1]

my java script code to locate element in protractor is below :

 element(by.css("insight-top-bar insight-predefined-charts-container button div")).click();
vimal
  • 9
  • 3

1 Answers1

0

you might want to add some dots to your locator, for the ones that might belong to a class

element(by.css('.insight-top-bar.insight-predefined-charts-container button div'))

Joaquin Casco
  • 704
  • 5
  • 14
  • thanks for reply - actually this are all my tags hence no . is required , using same CSS - I can check in dev tool that the elements are highlighting ok so I don't know what is wrong – vimal Oct 02 '19 at 17:16
  • can you provide us with a html snipped of the element, or what error you're getting? – Joaquin Casco Oct 02 '19 at 17:38
  • I am unable to attache an image of the code , however , it is not related to locator even I am unable to print the url of that page with below code const url3= await browser.getCurrentUrl(); console.log(url3); I can see on browser that I am able to login successfully and my site's landing page is displayed but unable to interact with it in any way – vimal Oct 02 '19 at 18:09