0 votes
1 view
in Devops and Agile by (25k points)

Can anyone tell me how I can identify and switch to the iframe which has only a title?

<iframe frameborder="0" style="border: 0px none; width: 100%; height: 356px; min-width: 0px; min-height: 0px; overflow: auto;" dojoattachpoint="frame" title="Fill Quote" src="https://tssstrpms501.corp.trelleborg.com:12001/teamworks/process.lsw?zWorkflowState=1&zTaskId=4581&zResetContext=true&coachDebugTrace=none">

I have tried by below code but it is not working


1 Answer

0 votes
by (63.3k points)

You can make use of the CSS Selector or Xpath as shown below:

Approach 1: CSS Selector

driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[title='Fill Quote']")));

Approach 2: Xpath

driver.switchTo().frame(driver.findElement(By.xpath("//iframe[@title='Fill Quote']")));

Check out this link:


Welcome to Intellipaat Community. Get your technical queries answered by top developers !