0

When i try to write XPath then sequence is breaking from ifame/#document/html. I want to reach the yellow highlighted line starting from div[@id='zdaasmodalbody'] i tried with, switchto window/frame but nothing works.

Please click to see the image

I tried this code but tool does not locate the element to identify its XPath:

cClickWait("/html/body/app-root/app-nav-menu/nav/a", "XPath");
Chris32
  • 4,716
  • 2
  • 18
  • 30
  • I am going to vote to close this question, unless you edit it and I dont want to click on links to see the image, post it on the question – Marcello Miorelli Oct 21 '19 at 11:50
  • 1
    Welcome to Stackoverflow. Please refer https://stackoverflow.com/help/how-to-ask and https://stackoverflow.com/help/mcve . Put more details of the issue that you are facing. Include the relevant code snippets you have tried so far. – Nagama Inamdar Oct 21 '19 at 12:06
  • I am unable to post the image in the question, i am a new user so stackoverflow does not allow me. – music fg3fg Oct 21 '19 at 12:07
  • Welcome! Please post (copy/paste) the **actual** code into the question body so we can see it. A link to an image is not very helpful. – Kevin Oct 21 '19 at 12:10
  • not a full answer but an idea where to look - you need to switch to that iframe first like here https://stackoverflow.com/questions/20425909/protractor-testing-angular-app-in-an-iframe – Sergey Pleshakov Oct 21 '19 at 13:51
  • @SergeyPleshakov Thank you so much, yes i followed the link and find my solution there. – music fg3fg Oct 21 '19 at 15:21

1 Answers1

0

You use below Xpath

//div[@id='zdaasmodalbody']//iframe[@class='ng-scope']

OR

//iframe[@class='ng-scope']

OR

//iframe[@class='ng-scope' and contains(@src,'https://')]

You need to switch to frame first as below before doing operation of its child elements

You can switch like:

driver.SwitchTo().Frame(driver.FindElement(By.Xpath("//div[@id='zdaasmodalbody']//iframe[@class='ng-scope']")));
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125