I have a page called Page A.
Page A contains the link. If you click that link Page B will open.
Now I need to enter the text in some of the fields in Page B.
How to do this by selectWindow
or any other command?
Please give me example.
Here is my piece of code which is not working:
|open | http://www.google.com | |
|type | q | selenium ide fourm |
|clickAt | btnG | |
|openWindowAndWait | http://seleni开发者_运维百科umforum.forumotion.net/ | |
|selectWindow | Selenium Forum: Open Source Testing Tool. | |
|ClickAndWait|xpath=/html/body/div/div/div/div/div/div[2]/div/ul/li[7]/a||
[error] Could not find window with title Selenium Forum: Open Source Testing Tool.
Thanks in advance
try to capture, all the window ids and using shift window command with the window ID, to shift your focus to second window. You can do this for multiple windows.
Try for commands, getallwindownames()
and shiftfocus()
.
|open | http://www.google.com | |
|type | q | selenium ide fourm |
|clickAt | btnG
|selectWindow | give the window title.
You can get the exact title of the window using view page source. Right click on the new window opened. Select View page source. Get the title of the newly opened window.
|selectWindow | null- focuses on the parent window.
精彩评论