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
rsumankumar1
Posts : 7
Join date : 2011-10-18

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

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
avatar
rsumankumar1
Posts : 7
Join date : 2011-10-18

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

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.
avatar
rsumankumar1
Posts : 7
Join date : 2011-10-18

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

Thu Oct 20, 2011 2:35 pm
Any ideas please ?
pushpendra
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

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

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
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

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

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

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

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.
pushpendra
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

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

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

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

Tue Nov 29, 2011 5:56 pm
Hm, maybe assertAlert(alertContent) ?
pushpendra
pushpendra
Active particpant
Active particpant
Posts : 23
Join date : 2011-09-26

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

Tue Nov 29, 2011 6:12 pm
can u tell me. more in detail about this assertAlert(alertContent) ?
avatar
faramka
Professional
Professional
Posts : 143
Join date : 2011-09-15
Location : Poland

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

Wed Nov 30, 2011 2:24 pm
http://seleniumhq.org/docs/02_selenium_ide.html#alerts
Sponsored content

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

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