Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
hresgil
Posts : 5
Join date : 2011-12-20

Issues with IE close browser, Firefox window focus. unable to get screenshots any browser Empty Issues with IE close browser, Firefox window focus. unable to get screenshots any browser

Tue Dec 20, 2011 8:58 pm
Hi, my name is Hernan,

I'm trying to build a test suit and after investigating about the proper tool to use, I came across to selenium.

But I have found the following problems, that if not resolved then I may need to start all over again looking for a different automation tool.

1 Can't get screenshots with selenium 2.13 and 2.15 on any browser.

2. I have tried to maximize the Firefox browser in many ways, but I never succeed.

3. There is no way I can get focus on Firefox, so I can’t maximize it using JRobot.

4. Finally, on internet Explorer I always get error when closing selenium (selenium.close and selenium.stop commands) and the browser does not close. Then other tests that follow cannot be continued until closing the browser manually.

Could anyone help please?

Note I'm using IE8 and Firefox 8.0.1 (windows XP and Windows Vista)
avatar
faramka
Professional
Professional
Posts : 143
Join date : 2011-09-15
Location : Poland

Issues with IE close browser, Firefox window focus. unable to get screenshots any browser Empty Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser

Wed Dec 21, 2011 3:09 pm
There is a command in Selenium to maximize window:
Code:
selenium.windowMaximize();
If this will not work, try it using js:
Code:
selenium.getEval("window.resizeTo(X, Y); window.moveTo(0,0);");

If you want to close browser, try this:
Code:
selenium.getEval("window.close");
avatar
hresgil
Posts : 5
Join date : 2011-12-20

Issues with IE close browser, Firefox window focus. unable to get screenshots any browser Empty Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser

Thu Dec 22, 2011 4:52 am
Thanks for your reply,

I have tried these suggestions, but neither one seem to work, could you please provide a working example?
avatar
hresgil
Posts : 5
Join date : 2011-12-20

Issues with IE close browser, Firefox window focus. unable to get screenshots any browser Empty Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser

Mon Dec 26, 2011 9:05 pm
Hi,

I managed to maximize Firefox browser with the java script code as suggested by faramka.

Code:

selenium.getEval("window.resizeTo(screen.availWidth, screen.availHeight); window.moveTo(screen.availWidth, screen.availHeight);");


But unfortunately the program (eclipse) used to launch selenium RC, remains at the front and I have been unable to bring the main browser to the front of the screen.

I have tried 'selenium.windowFocus' and

selenium.getEval("wondow.focus"); but neither works.

I'm still trying to capture screenshots but no luck so far.

Any help would be very much appreciated thanks please?


avatar
faramka
Professional
Professional
Posts : 143
Join date : 2011-09-15
Location : Poland

Issues with IE close browser, Firefox window focus. unable to get screenshots any browser Empty Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser

Tue Dec 27, 2011 2:37 pm
Try use getAllWindowIds() or getAllWindowNames() and then selectWindow(). Read documentation for getting to know these commands.
avatar
jaffarlone
Posts : 1
Join date : 2012-01-23

Issues with IE close browser, Firefox window focus. unable to get screenshots any browser Empty Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser

Tue Jan 24, 2012 3:15 pm
Hi, am facing similar problem, tried using getAllWindowIds(), it will print "id isundefined" on the console, my code is like this:

String getwindowid = "";
for(int i=0; i getwindowid = getwindowid + windowids[i];

}
System.out.println("id is" + getwindowid);
Sponsored content

Issues with IE close browser, Firefox window focus. unable to get screenshots any browser Empty Re: Issues with IE close browser, Firefox window focus. unable to get screenshots any browser

Back to top
Permissions in this forum:
You cannot reply to topics in this forum