Switching control in tabs in Selenium - selenium-webdriver

While doing automation for my Web page through selenium,when i try to click on a button called "Learn More" it opens a page in a new tab and automatically closes the old tab.(This is a specific case for IE). The main problem is that i am not able to click on the link present in the new tab, the control is not getting switched to the new tab.
I tried all the possibilities of switching windows and switching tabs , but both has not helped me.
And as a result I end up with "No Such Window Exception."
Please help.

Related

How to read source code of a dialog box in Internet Explorer 9

I am automating a web application using ruby and selenium-webdriver which contains multiple fields in dialog boxes. And these dialog boxes contains lot of nested iframes. I am unable to get the element properties using the Developer Tool as everything is disabled for a dialog box. For the time being i am using page_source function of selenium webdriver to read the source but it is of little use in case of nested frames.
Please tell me a good way to identify elements in a dialog box in Internet Explorer
Follow below steps to fix this issue
Open Internet Explorer
Click the "Tools" gear (Alt+X)
Select "Internet options"
Select the "Security" tab
Click the "Custom level..." button
6 .Disable the "Allow websites to open windows without address or status bars" option
Hit OK
Hit OK
Now find a modal window and press F12
Source: http://blogs.msdn.com/b/kurlak/archive/2012/08/27/opening-the-internet-explorer-developer-tools-dialog-on-modal-windows.aspx

How access weblements in a child window in IE8 browser

I am trying to access web elements in a child window in IE8 browser.
I am not able to access any of the element in that child window, I tried Developer tools (F12) in browser, macros to get X path, page source to get ID/name for the elements but nothing is working there. Could some one help me please
What do you mean by :-
nothing is working there?
Be specific.
You can open the website in Firefox or some other advanced web-browser to get the element's selectors and later run the automated scripts using IE 8 driver.
Check the code in the answer provided for a similar question -
Java: focus is not on pop-window during window handling
EDIT: Other approaches--
Try the following steps (Manually):
Open main page, hit F12 to open developer toolbar.
Perform action that opens the popup.
Focus on popup and hit F12. You should see a developer toolbar.
Check this screenshot - http://snag.gy/pPXLX.jpg
As an alternative you may also try getting the URL of the popup and open in a new tab in the main browser window and then do F12 to inspect any elements.

opening new tab on click in silverlight application fails for more than 1 tab

I have a requirement in silverlight. Whenever i click on the grid row, its details should open in new tab. I have implemented the same, but the problem comes when I click a particular link continuously.In that case i get debug error. If I give some time between the clicks like 1-2 secs, then i can open as many tabs i want.
I have used the following code :
HtmlPage.Window.Navigate(URI, "_blank");
Using this whole application starts again.
Help would be appreciated.

Force URL to open in tab in IE7

I have a link in my webdatagrid as follows:
I open the link using following:
var PageURL = "XYZ.aspx?XYZID=" + rows.get_cell(8).get_value();
window.open(PageURL, "", "menubar=1,resizable=1,location=1,scrollbars=1");
Now my problem is that, it works perfectly fine when the settings of IE& is
"When popup encountered:>>> Always open pop-ups in a new window and Always open pop-ups in a new tab
but when the setting is "Let Internet Explorer decide how pop-ups should open" it creates a problem and it opens in a new window and that window has lot of issues.
Please help me to force URL to open in new tab only.
This is not possible. This can only be controlled in the browser and not by the website.
Detail:
You (webdeveloper) can specify if a link should open in a new window. The visitor can specify if a new window should open in a new browser window or in a new tab.

blurring a web page in silverlight

i have a web page that has to go dim on page load and some box comes over.
the box has to have a TextBox. this box takes some input from the user. and on click
on a submit button the TextBox info is to be checked on server and then accordingly the
already dimmed web page may go normal(usable) or keep dimmed.
very much like what happens on opening the home page of www.sulekha.com
please guide me on this.
thankQ
have you tried using the ChildWindow in the Silverlight Toolkit, does that not give you the intended "modal" + "grey out background" behaviour
http://silverlight.codeplex.com/wikipage?title=Silverlight%20Toolkit%20Overview%20Part%204
Sample here:
http://silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html

Resources