1

I am trying to select a frame in a dojo page with the selenium method shown below is failing

driver.switchTo().frame(target);

I have passed title attribute as my target value. For the target i do not have id or name attributes, how could i pass the target value for the below element.

<iframe frameborder="0" title="Universal Line Template Configuration" style="width:100%;height:100%;" src="/ucmadmin/ccmadmin-latest?name=universalLineTemplate&key=a91ffd45-a34f-bc90-c159-1bef9e7c9921&permission=3">

When i check by clicking a button in a dojo page, the selenium IDE is showing two operations for a single click, as shown below

click     id=g_btnExpandAll_label
click     name=g_btnExpandAll

Is anything to be done apart from the line driver.switchTo().frame(target);?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195

1 Answers1

1

You need to locate the frame first. For example, by xpath relying on the title tag:

WebElement frame = driver.findElement(By.xpath('//iframe[@title="Universal Line Template Configuration"]'));

The use it as a target:

driver.switchTo().frame(frame);

See also:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195