Identifying frames in selenium webdriver, when frame dont have ids

0 votes

How to identify and switch Iframe which only has a title, as shown:

<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 tried the below code but it is not working for me:

driver.switchTo().frame(driver.findElement(By.tagName("iframe")));
May 10, 2018 in Selenium by Martin
• 4,220 points
755 views

1 answer to this question.

0 votes

In Selenium WebDriver, if you don't find any id or any other attribute then go for css selectors.

So, this can be solved using css selector, the code is given below:

driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[title='Fill Quote']")));
answered May 10, 2018 by Meci Matt
• 9,420 points

Related Questions In Selenium

0 votes
1 answer

what is the need of xpath when you have attributes like id ,class,name in selenium?

It is not necessary that every element ...READ MORE

answered Jun 1, 2018 in Selenium by Vinita
• 220 points
216 views
0 votes
1 answer
0 votes
3 answers

How to specify "ENTER" button functionality in Selenium WebDriver code?

using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); ...READ MORE

answered Feb 12 in Selenium by anonymous
11,261 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
918 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,104 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
840 views
0 votes
1 answer

XPath for the elements with no ID or Name in Selenium Webdriver

Use like this or similar to this: //div[@id="top-level-menu-item-3"]/div[@class="filter-label"] //div[@id="top-level-menu1"] ...READ MORE

answered Apr 17, 2018 in Selenium by Meci Matt
• 9,420 points
1,448 views
0 votes
1 answer