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
faramka
Professional
Professional
Posts : 143
Join date : 2011-09-15
Location : Poland

Checking if save dialog is displayed Empty Checking if save dialog is displayed

Mon Nov 07, 2011 7:44 pm
I write a test of exporting some data. When I click button "export", the browser should display a save dialog. Sometimes (with bad input data) there is an error and no data is exported. And my question is: how to check if a save dialog is displayed?
Does anyone have any ideas or just have had faced with such simulation?

I'm using Selenium with PHPUnit.
avatar
freesky
Amateur
Amateur
Posts : 72
Join date : 2011-04-13

Checking if save dialog is displayed Empty Re: Checking if save dialog is displayed

Tue Nov 08, 2011 8:21 am
for example, if the save dialog is displayed, then there is the corresponding html code, such as :
, so you can use 'waitForElementPresent()' to check the element is presented or not
avatar
faramka
Professional
Professional
Posts : 143
Join date : 2011-09-15
Location : Poland

Checking if save dialog is displayed Empty Re: Checking if save dialog is displayed

Tue Nov 08, 2011 2:29 pm
freesky, thank you for answer.
But I don't know how I should define dialog in my code? I can't do this by css/xpath in usual way, can I? The save dialog in Firefox hasn't got any attribute.
avatar
faramka
Professional
Professional
Posts : 143
Join date : 2011-09-15
Location : Poland

Checking if save dialog is displayed Empty Re: Checking if save dialog is displayed

Tue Nov 08, 2011 2:57 pm
OK, I finally solved this problem in other way Smile

I use getAllWindowNames() to detect if the save dialog is displayed.
When the save dialog is presented, this method return an array with these values:
Code:
Array
(
    [0] => selenium_main_app_window
    [1] => selenium_blank32686
)
And when there is just one main window of application, the returned array has got one value:
Code:
Array
(
    [0] => selenium_main_app_window
)
I noticed that a name of the save dialog has got always selenium_blank and random five digits.

So I simply check a count of all presented windows in my app, 'cause in the other case (error) there is still one main window.
avatar
freesky
Amateur
Amateur
Posts : 72
Join date : 2011-04-13

Checking if save dialog is displayed Empty Re: Checking if save dialog is displayed

Wed Nov 09, 2011 8:05 am
thank you for your sharing, it's another workaround.
Sponsored content

Checking if save dialog is displayed Empty Re: Checking if save dialog is displayed

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