Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Checking if save dialog is displayed

View previous topic View next topic Go down

Checking if save dialog is displayed

Post by faramka on 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.

faramka
Professional
Professional

Posts : 143
Join date : 2011-09-15
Location : Poland

Back to top Go down

Re: Checking if save dialog is displayed

Post by freesky on 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

freesky
Amateur
Amateur

Posts : 72
Join date : 2011-04-13

Back to top Go down

Re: Checking if save dialog is displayed

Post by faramka on 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.

faramka
Professional
Professional

Posts : 143
Join date : 2011-09-15
Location : Poland

Back to top Go down

Re: Checking if save dialog is displayed

Post by faramka on 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.

faramka
Professional
Professional

Posts : 143
Join date : 2011-09-15
Location : Poland

Back to top Go down

Re: Checking if save dialog is displayed

Post by freesky on Wed Nov 09, 2011 8:05 am

thank you for your sharing, it's another workaround.

freesky
Amateur
Amateur

Posts : 72
Join date : 2011-04-13

Back to top Go down

Re: Checking if save dialog is displayed

Post by Sponsored content Today at 3:47 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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