I have an iframe in one of my application pages and whenever I load that page, all the ribbon controls i.e. the Site Actions menu and the User menu dont work. I mean when I click on them nothing happens. After I while I realized they were hidden behind the iframe. I tried using the Jquery bgiframe plugin on the ribbon container but that didn't work either.
UPDATE 1:
This is so weird! I just had to end the iframe tag like this </iframe> instead of /> and now the ribbon controls work!! Am I missing something here?
Sounds like you need an iframe shim: http://www.dynamicdrive.com/forums/entry.php?249-A-better-Iframe-Shim
Did you try to place the IFrame in a with a z-index? <div style="display:block;position:absolute;top:0px;z-index:999;">YOUR FRAME HERE</div>
Related
I am trying to access a radio button inside an iframe when running tests on a web application on Selenium.
The button inside the forms looks like
<input type="radio" value="facebook" onclick="onClick()"> Facebook
And I try to access it using
this.browser.element(by.xpath('//input[#value = \'facebook\']'))
But that doesnt seem to find the element. Any feedback appreciated. Thanks.
Basically when you have iframe you need to switch over the element.
There are 3 ways to switch to the frame:
By Index
By Name or Id
By WebElement
Here is how to switch:
driver.switchTo().frame(index/name/webelement);
You can identify the number of the iframes in the page by:
Int size = driver.findElements(By.tagName("iframe")).size();
Hellow guys, please guide me to solve issue.
I am able to access all fields inside the iframe which is in div, I want to close iframe but I am unable to access (X) button.
The close button is outside iframe and inside div.
Here is my code:
To switch into iframe from main window:
BaseClassOne.driver.switchTo().frame(BaseClassOne.driver.findElement(By.xpath("//*[#id='Dealership quote Internal']/iframe")));
To access iframe element:
BaseClassOne.driver.findElement(By.xpath("//*#id='txtDealershipRef']")).sendKeys("XYZ090123");
I tried below mention code to close modal popup window:
BaseClassOne.driver.findElement(By.tagName("a")).click();// throwing no such element exception
BaseClassOne.driver.close();// this is closing browser instance
BaseClassOne.driver.switchTo().defaultContent();
// modal pop-up is not closing hence not able to access main window element
Please guide me.
Thanks in advance.
According to the above comments and discussions, I feel that you have to switch back to the default frame and then try to click on the close button.
driver.switchTo().defaultContent();
There seems to be an issue with the code sequence. Considering the close link is not contained in the iframe you have to switch to default content first and then click on close before proceeding. Try the following code:
//Switch to frame and perform actions
BaseClassOne.driver.switchTo().frame(BaseClassOne.driver.findElement(By.xpath("//*[#id='Dealership quote Internal']/iframe")));
BaseClassOne.driver.findElement(By.xpath("//*#id='txtDealershipRef']")).sendKeys("XYZ090123");
//switch to default content (to access elements outside the frame)
BaseClassOne.driver.switchTo().defaultContent();
//click on close
BaseClassOne.driver.findElement(By.xpath("//a[#class='close-window']")).click();
Note: the identifier for the close button has been changed in the code here to use the properties from the HTML sinceBy.tagName("a") which is a part of the code in the question could possible have many matching nodes which are higher up in the HTML hierarchy.
I make a partialRefresh on a tab container with 4 tabs:
<xp:eventHandler event="onchange" submit="true"
refreshMode="partial" refreshId="djContentPane1">
<xp:this.action><![CDATA[#{javascript:viewScope.put("hideRelatedDocuments", true);}]]></xp:this.action>
</xp:eventHandler>
The viewScope is then used to some fields which I want to hide/show. Those fields lay on the tab container.
And after this, the tab container looks strange:
What might be the problem? Thanks for your time.
I tried adding a mainPanel, and on this panel I added the TabContainer. Then, I updated the panel but sttill, no work. The result:
You can refresh the fields to show/hide them depending on current value in combobox field if you
put the fields into panels which have an id and always gets rendered
place the panels into the Tab Panels
refresh all panels on onchange event of your combobox with XSP.partialRefreshPosts
Look for the sample code here.
It's because you're refreshing the content pane. I've not pinned down the cause, but refresh either an area outside the Dojo Tab Container or a panel/div that's inside the Tab Container Pane you want to refresh.
I suspect it's something to do with Dojo then processing the response HTML. As a client-side framework, I don't think Dojo is really designed to handle replacing HTML by injection into an existing page.
Tommy Valand added a snippet to handle this problem: http://dontpanic82.blogspot.co.uk/2013/03/fix-for-partial-refresh-on-dojo-tab.html
I have all anchor tags in left side contentpane of my web page. When i click a link, it will navigates to another another web page. i want that destination web page should open in my center contentpane.
I have hust started DOJO.Please Help me to solve this issue.
Page1
// page1.jsp should open in this section
Note: This example is working only for Dojo 1.8+
Assuming that you have something similar to:
<div data-dojo-type="dijit/layout/ContentPane">
show /link1 in targetPane
show /link2 in targetPane
...
</div>
<div data-dojo-type="dijit/layout/ContentPane" id="targetPane"></div>
The basic instructions follow:
1) Intercept click events on the anchors.
For instance, you can mark the anchors you want to target the content pane with .menuLink class:
show /link1 in targetPane
...then for clicks on those elements:
on(query('.menuLink'), 'click', function(e) {...})
2) Handle the event
Use e.preventDefault(); so that clicking the links won't reload the whole page (as in your current situation :)
Instead instruct the pane to load the link from the anchor:
registry.byId('targetPane').set('href', e.target.getAttribute('href'));
Example
Working example is here (since I've skipped all of the Dojo boilerplate)
On http://www.beautycenterelysee.be/behandeling-acne-microdermabrasie#tabs-5 I am using a jQuery accordion inside a jQuery tab-panel. My client wants to open the second panel on page-load with a link on another page. Is this possible?