- rsumankumar1
- Posts : 7
Join date : 2011-10-18
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
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
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.
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
Re: How to retrieve the URL of a link in my current page.
Thu Oct 20, 2011 2:35 pm
Any ideas please ?
- pushpendraActive particpant
- Posts : 23
Join date : 2011-09-26
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
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
- pushpendraActive particpant
- Posts : 23
Join date : 2011-09-26
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
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
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
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.
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.
- pushpendraActive particpant
- Posts : 23
Join date : 2011-09-26
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 .?
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 .?
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: How to retrieve the URL of a link in my current page.
Tue Nov 29, 2011 5:56 pm
Hm, maybe assertAlert(alertContent) ?
- pushpendraActive particpant
- Posts : 23
Join date : 2011-09-26
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) ?
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
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
- How to verify element in a new page from link.
- Facing a problem while moving from non secure page to secure page.
- How to use WebDriverEventListener in Page Object Model design Pattern with Page Factory
- my selenium html file opens the code page rather than web page
- how to compare 2 ULR's which is exist in same web page (View page source).
Permissions in this forum:
You cannot reply to topics in this forum
|
|