Does using collapsible elements can reduce server overload? - jquery-mobile-collapsible

For an exemple, I'm making an Iphone webapp and I intend to use jquery collapsible elements to make the app faster. So, when you do that will the collapsed elements still load and are just hidden or will it indeed help retrieve only the requested content? Thanks! ps. Any suggestions to reduce the server work by using elements that only load when requested for mobile apps would be very appreciated.

Marking the element with a css hidden directive does not cause the server to skip sending that element to the browser. All the DOM elements are retrieved from the server for collapsible elements as written in you HTML file. In order to make the server load dynamically(as you select a expandable element) you would need to add an AJAX call that loads the relevant information into the DOM when the element is expanded.

Related

Accessing elements inside iFrame documents in Selenium WebDriver

I am trying to automate a scenario where I would need to access elements inside an iFrame and continue my testing.
My current problem is that, I am able to switch to the iframe successfully, but I am unable to access contents inside the frame.
The contents inside the iframe are Shadow DOM contents and are inside a document.
The HTML code looks like this::(Please see attachedHTML)
I have tried the below and get
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element
By accessing the shadow root
driver.switchTo().frame("iframe_id");
WebElement root1 = driver.findElement(By.className("class_abs"));
WebElement shadowRoot1 = expandRootElement(root1);
Here webdriver is unable to find element by classname.
2.By using Javascript executor
driver.switchTo().frame("iframe_id");
JavascriptExecutor js=(JavascriptExecutor) driver;
js.executeScript("arguments[0].click();", driver.findElement(By.xpath("button_xpath")));
Here webdriver is unable to access the Xpath.
3.
Using normal Xpath after switching to IFrame.
I would like to know if I need to access the contents of the document inside iFrame first to access its elements. If that is the case, how can I do it.
P.S- Tried this on both chrome and Firefox browser.
All,
I have finally managed to resolve the issue.
So the issue resolutions goes like this.
-The frame designed on the page were actually hidden.
-I had to switch to the hidden frame after switching to the main frame.
-Then the elements were then identified easily.
Problems what I faced:
1. In Firefox browser-The hidden frame was not detected in the 'Firefinder' when I checked with filter 'frame' which was detecting all the frames except the hidden frame. Same was the case with 'Firepath'
2. In Chrome browser- Though the document inside the main frame was displayed, traversing inside did not show the hidden iframe.
Solution:
In Firefox browser, inspecting the element using the HTML tab helped me to identify the hidden frame inside the main frame.
Carefully traversing the iframe hidden document helped me.
But, I am still not sure why the Chrome browser 'Inspect' doesn't show this frame.

RadWindow UI Issue

So I added a RadWindow to my aspx page
file1.aspx (points to cssfile1.css)
Within that aspx file, there's a RadWindow which opens a RadWindow that contains another aspx file
file2.aspx (points to cssfile2.css)
My question is, how do I override the CSS in file2.aspx that seems to be messing with the RadWindow. And if it is the CSS in file1.aspx, how do I omit the CSS for this RadWindow?
It is the main file (cssfile1.css from page1.aspx). The second pair are loaded in an iframe so they don't affect the topmost frame.
To resolve the problem, there are three approaches:
try the Lightweight RenderMode as it uses more semantic HTML so it may not get affected (i.e., it is not a table): http://docs.telerik.com/devtools/aspnet-ajax/controls/window/mobile-support/render-modes.
Do a binary search in the stylesheet to find the offending rule and make it specific enough so it does not target all HTML elements. Basically, follow this article: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/distorted-appearance
use the browser dev toolbar to find the elements in the RadWindow that are affected by your rules and add a heavier CSS selector that will reset them (e.g., remove paddings you add, whatever).

Immediately clearing the contents of an IFrame in Flex

I have a Flex HTML component that is displaying content from a remote URL and a button in the Flex application that reloads the content. However, it takes a few seconds for the IFrame's content to refresh. During this time, there is no obvious feedback to the user that any action is underway.
I would like to clear the contents of the IFrame, so there is immediate feedback after clicking refresh, and then load the remote URL again. Is there a way to do this?
I've tried setting the HTMLText property to "" and setting the IFrame location to "about:blank", and neither of these have the desired immediate effect. (on it's own, setting the location to about:blank immediately clears the IFrame, but if it is followed by resetting the location to the original URL, the immediate clearing doesn't occur. Is this something to do with the IFrame caching the original page?)
One approach is to remove the component from the display list and add a new instantiated component back in its place.
This will assure fully initialized state.
One other way you could get around would be having a blank iframe or loading screen ready with the same size and same position, while the contents are being loaded, hide the content iframe, and show the blank iframe or loading screen. This could be much easier to achieve a more flexible result.

popups in asp.net

i want to display the pop ups in asp.net page like how the stack over flow show the pop ups on the top of the site (you get the new answer for the question like that in a orange color) how can i write the code is there any free source code or any reference. thank you
Given below are the steps to achieve what you want.
Have a div (a container) to show your updates
Create a window.setTimeout to execute a JS function (AJAX)
In that function check for updates from server
Finally if there are any updates then show it in the div container
When there are updates then again setTimeout to make it invisible over a period of time (say 3 secs)
To achieve this in a very easy fashion use JS libraries like JQuery.
HTH
Thats not a 'popup', its probably just a standard DIV that has its height and content changed dynamically. You can do a "view source" on the page to locate the item, or use firebug (easier).
After looking, its a div called 'notify-container'.
These days, all that wizzery is generally done with jQuery
The asp.net ajax control toolkit has that. Check it out here.
I think you'll find that's done using a holding container at the top of the page, a timer to periodically query an AJAX enabled method for updates which replaces the content of the container based on the response.

ASP.NET Menu Parent Menu Item Highlighting on Hover when Flyouts are enabled

I have a ASP.Net Menu Control with three levels and flyouts enabled.
I want to highlight the parent items (right upto the top level parent) whenever a user hovers over the menu items.
I do not want to use a client side solution as described here:
http://www.codeproject.com/KB/webforms/AspMenuParentHighlighting.aspx
Is there an elegant server side solution?
Kind regards.
The only server side solution I can think of would be to set the client side solution on page load.
Is there a reason that you would want to build this server side rather than client side? Because forcing an event like this to occur server side is, by definition, rather inelegant.

Resources