Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to retrieve the URL of a link in my current page.

View previous topic View next topic Go down

How to retrieve the URL of a link in my current page.

Post by rsumankumar1 on Tue Oct 18, 2011 9:57 pm

Hello,

I am totally new to this forum and to selenium. Please help me with this basic functionality.

I have a web page that has a component displayed as some image but internally it is a link to a ".zip file" which opens up when i click on that image. This is deployed on the same domain/host/server.

Now, as part of my selenium test case, i need to click on that image (it opens up a new window with content of the file) and in that i have to search for a text.

So to do this, i recorded my test case but the problem is that i am not able to "select" the newly opened window so as to search for the text.
I tried many methods like selenium.getAllWindowTitles/Ids etc ... but i guess i am missing something here.


Could you please let me know what is the correct approach for this.
Appreciate you help.

Thanks,
Suman

rsumankumar1

Posts : 7
Join date : 2011-10-18

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by rsumankumar1 on Wed Oct 19, 2011 8:24 pm

Hi,

Any ideas on this please ? Basically what i am trying to achieve is to search for a text in the newly opened window. selectWindow() , openWindow() is not shifting the focus to the new one.

rsumankumar1

Posts : 7
Join date : 2011-10-18

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by rsumankumar1 on Thu Oct 20, 2011 2:35 pm

Any ideas please ?

rsumankumar1

Posts : 7
Join date : 2011-10-18

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by pushpendra on Thu Oct 20, 2011 4:44 pm

hi,
when there is any another web page opens to focus on new window first

use
thread.currentThread().sleep(1000)

and then use selenium.

to get focus in firefox u can use
selenium.selectWindow(selenium.getAllWindowNames()[selenium.getAllWindowNames().length-1])

and for IE
selenium.selectWindow("Window title");

hope this can help u
all d bst

pushpendra
Active particpant
Active particpant

Posts : 23
Join date : 2011-09-26

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by pushpendra on Wed Nov 23, 2011 8:07 pm

hi,
i am facing problem in handling validation pop up window.
getAllWindowTitle() , getAllWindowNames() and isAlertPresent() .
Nothing is wrkin for me.

Can you help me another way to handle validation alert.

Thanks

pushpendra
Active particpant
Active particpant

Posts : 23
Join date : 2011-09-26

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by faramka on Wed Nov 23, 2011 9:10 pm

In which way the validation information is presented? Is it a javascript alert, a message in a new browser window or just an element (for example: div) which looks like it was on the surface of the site?

It probably is not a new browser window, so you can't use getAllWindowTitle() or getAllWindowNames() or any other getAllWindow... method.
If it is a javascript alert - see this topic.
If it is an HTML element, you can verify its presenting by using assertElementPresent() command.

faramka
Professional
Professional

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

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by pushpendra on Tue Nov 29, 2011 5:18 pm

hi,
thanks for your answer.
But i am using selenium not the driver and when i am using selenium.isAlertPresent() is giving false.
Although alert is present ?


is there any other way to handle this alert .?

pushpendra
Active particpant
Active particpant

Posts : 23
Join date : 2011-09-26

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by faramka on Tue Nov 29, 2011 5:56 pm

Hm, maybe assertAlert(alertContent) ?

faramka
Professional
Professional

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

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by pushpendra on Tue Nov 29, 2011 6:12 pm

can u tell me. more in detail about this assertAlert(alertContent) ?

pushpendra
Active particpant
Active particpant

Posts : 23
Join date : 2011-09-26

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by faramka on Wed Nov 30, 2011 2:24 pm

http://seleniumhq.org/docs/02_selenium_ide.html#alerts

faramka
Professional
Professional

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

Back to top Go down

Re: How to retrieve the URL of a link in my current page.

Post by Sponsored content Today at 8:54 am


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