-
Notifications
You must be signed in to change notification settings - Fork 782
Modified Window Handling to be able to work over all active Browsers. #1412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c9d34be
Added Keywords "Get Browser Ids" and "Get Browser aliases" to get a l…
Snooz82 a01d4e9
Added "Switch Window" as replacement for select window.
Snooz82 171f45a
Added Option "browser" to "Switch Window" (only CURRENT or <id or ali…
Snooz82 9c13ba6
Updated Doc-Strings.
Snooz82 fca3b88
Added example for Browser and window handling in Doc
Snooz82 1275d5b
Select Window deprecation warning to silent.
Snooz82 7b209bd
more improvements in documentation on window related keywords.
Snooz82 7bd1b06
small improvement to Get Browser Aliases documentation.
Snooz82 efa0c5c
Moved window related keywords back to BrowserManagementKeywords to ov…
Snooz82 c635d48
Fixed ordering get_session_id
Snooz82 cfb63b4
Fixed Unittest to 173 Keywords instead of 170.
Snooz82 0230744
Set encoding to UTF-8 to be able to use all characters in Docstring
Snooz82 31bf5ea
Fixed Issues with aTest
Snooz82 338170d
Added acceptance tests for edited Window- and Browser-Information han…
4bb064e
Get rid of the for loop in atest because of Robot Framework 3.0.4 in …
Snooz82 d12a0b3
Cleaned up all Lines that are only made out of whitespaces.
Snooz82 a2af1cd
fixed not needed parenthesis
Snooz82 ce19471
Updating Doc. implementing review comments.
Snooz82 b03365f
Prepare Solve Conflict
Snooz82 e2cda08
prepare for solve conflicts
Snooz82 e6db026
Merge branch 'master' of https://github.com/robotframework/SeleniumLi…
Snooz82 a0200f7
Merge branch 'robotframework-master'
Snooz82 dd6f770
Added an exapmle Test to switch to w window of another Browser by its…
Snooz82 83d8a9d
Updated documentation
aaltat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
163 changes: 163 additions & 0 deletions
163
atest/acceptance/multiple_browsers_multiple_windows.robot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| *** Setting *** | ||
| Documentation These tests must open own browser because windows opened by | ||
| ... earlier tests would otherwise be visible to Get Window XXX keywords | ||
| ... even if those windows were closed. | ||
| Suite Setup Open 3 Browsers with Windows | ||
| Suite Teardown Close All Browsers | ||
| Resource resource.robot | ||
|
|
||
| *** Variables *** | ||
| @{BrowserA_EXP_TITLES}= WindowA1 WindowA2 WindowA3 | ||
| @{BrowserB_EXP_TITLES}= WindowB1 WindowB2 | ||
| @{BrowserC_EXP_TITLES}= WindowC1 | ||
| @{ALL_BROWSERS_EXP_TITLES}= @{BrowserA_EXP_TITLES} @{BrowserB_EXP_TITLES} @{BrowserC_EXP_TITLES} | ||
| @{EXP_ALIASES}= BrowserA BrowserB BrowserC | ||
| @{EXP_IDS}= ${1} ${2} ${3} | ||
|
|
||
|
|
||
| *** Test Cases *** | ||
| Check Titles of Multiple Browser-Windows | ||
| @{BrowserA_Titles}= Get Window Titles browser=BrowserA | ||
| Should Be Equal ${BrowserA_Titles} ${BrowserA_EXP_TITLES} | ||
| @{BrowserB_Titles}= Get Window Titles browser=BrowserB | ||
| Should Be Equal ${BrowserB_Titles} ${BrowserB_EXP_TITLES} | ||
| @{BrowserC_Titles}= Get Window Titles browser=BrowserC | ||
| Should Be Equal ${BrowserC_Titles} ${BrowserC_EXP_TITLES} | ||
| @{All_Browsers_Titles}= Get Window Titles browser=ALL | ||
| Should Be Equal ${All_Browsers_Titles} ${ALL_BROWSERS_EXP_TITLES} | ||
|
|
||
| Check Count of Handle | ||
| Check Handle Count 3 BrowserA | ||
| Check Handle Count 2 BrowserB | ||
| Check Handle Count 1 BrowserC | ||
| Check Handle Count 6 ALL | ||
|
|
||
| Check Count of Names | ||
| Check Name Count 3 BrowserA | ||
| Check Name Count 2 BrowserB | ||
| Check Name Count 1 BrowserC | ||
| Check Name Count 6 ALL | ||
|
|
||
| Check Count of Identifiers | ||
| Check Identifiers Count 3 BrowserA | ||
| Check Identifiers Count 2 BrowserB | ||
| Check Identifiers Count 1 BrowserC | ||
| Check Identifiers Count 6 ALL | ||
|
|
||
| Check Locations | ||
| @{Locations}= Get Locations browser=ALL | ||
| Should Be Equal As Strings @{Locations}[0] ${FRONT_PAGE}javascript/dynamic_content.html?1 | ||
| Should Be Equal As Strings @{Locations}[1] ${FRONT_PAGE}javascript/dynamic_content.html?2 | ||
| Should Be Equal As Strings @{Locations}[2] ${FRONT_PAGE}javascript/dynamic_content.html?3 | ||
| Should Be Equal As Strings @{Locations}[3] ${FRONT_PAGE}javascript/dynamic_content.html?4 | ||
| Should Be Equal As Strings @{Locations}[4] ${FRONT_PAGE}javascript/dynamic_content.html?5 | ||
| Should Be Equal As Strings @{Locations}[5] ${FRONT_PAGE}javascript/dynamic_content.html?6 | ||
| ${count} Get Length ${Locations} | ||
| Should Be Equal As Integers 6 ${count} | ||
|
|
||
| Get Browser Ids and Alias | ||
| @{Aliases}= Get Browser Aliases | ||
| Should Be Equal ${Aliases} ${EXP_ALIASES} | ||
| &{Aliases}= Get Browser Aliases | ||
| Should Be Equal ${Aliases.BrowserA} ${1} | ||
| Should Be Equal ${Aliases.BrowserB} ${2} | ||
| Should Be Equal ${Aliases.BrowserC} ${3} | ||
| @{IDs}= Get Browser Ids | ||
| Should Be Equal ${IDs} ${EXP_IDS} | ||
|
|
||
| Select Window by Location | ||
| Switch Browser BrowserA | ||
| Switch Window WindowA1 | ||
| Switch Window By Location ${FRONT_PAGE}javascript/dynamic_content.html?5 | ||
| ${location} Get Location | ||
| Should Be Equal ${FRONT_PAGE}javascript/dynamic_content.html?5 ${location} | ||
| Title Should Be WindowB2 | ||
|
|
||
| Switch Window to Different Browser | ||
| Switch Browser BrowserC | ||
| Switch Window WindowC1 | ||
| Location Should Be ${FRONT_PAGE}javascript/dynamic_content.html?6 | ||
| Switch Window title:WindowA1 browser=BrowserA | ||
| Location Should Be ${FRONT_PAGE}javascript/dynamic_content.html?1 | ||
| Switch Window url:${FRONT_PAGE}javascript/dynamic_content.html?4 browser=BrowserB | ||
| Title Should Be WindowB1 | ||
|
|
||
| Get Specific Locations and Title | ||
| Switch Browser BrowserA | ||
| Switch Window title:WindowA1 | ||
| Location Should Be ${FRONT_PAGE}javascript/dynamic_content.html?1 | ||
| @{Locations}= Get Locations browser=BrowserB | ||
| Should Be Equal @{Locations}[0] ${FRONT_PAGE}javascript/dynamic_content.html?4 | ||
| Should Be Equal @{Locations}[1] ${FRONT_PAGE}javascript/dynamic_content.html?5 | ||
| ${count}= Get Length ${Locations} | ||
| Should Be Equal As Integers ${count} 2 | ||
| @{Titles}= Get Window Titles browser=BrowserC | ||
| Should Be Equal @{Titles}[0] WindowC1 | ||
| ${count}= Get Length ${Titles} | ||
| Should Be Equal As Integers ${count} 1 | ||
|
|
||
|
|
||
| Fail Switching Window and Locations From Different Browser | ||
| Switch Browser BrowserA | ||
| Switch Window WindowA1 | ||
| ${Error_Msg}= Run Keyword And Expect Error * Switch Window WindowB1 | ||
| Should Be Equal As Strings ${Error_Msg} No window matching handle, name, title or URL 'WindowB1' found. | ||
| ${Error_Msg}= Run Keyword And Expect Error * Get Locations browser=UnknownBrowser | ||
| Should Be Equal As Strings ${Error_Msg} Non-existing index or alias 'UnknownBrowser'. | ||
| ${Error_Msg}= Run Keyword And Expect Error * Get Window Handles browser=${4} | ||
| Should Be Equal As Strings ${Error_Msg} Non-existing index or alias '4'. | ||
|
|
||
|
|
||
|
|
||
| *** Keywords *** | ||
| Open 3 Browsers with Windows | ||
| Close All Browsers | ||
| Open Browser With Alias And Title BrowserA WindowA1 1 | ||
| Open New Window and set Title WindowA2 2 | ||
| Open New Window And Set Title WindowA3 3 | ||
| Open Browser With Alias And Title BrowserB WindowB1 4 | ||
| Open New Window And Set Title WindowB2 5 | ||
| Open Browser With Alias And Title BrowserC WindowC1 6 | ||
|
|
||
| Open New Window And Set Title | ||
| [Arguments] ${title} ${id} | ||
| Execute Javascript window.open("dynamic_content.html?${id}") | ||
| Switch Window locator=NEW | ||
| Set Window Title ${title} | ||
|
|
||
| Open Browser With Alias And Title | ||
| [Arguments] ${alias} ${title} ${id} | ||
| Open Browser ${FRONT_PAGE}javascript/dynamic_content.html?${id} ${BROWSER} alias=${alias} | ||
| Set Window Title ${title} | ||
|
|
||
| Set Window Title | ||
| [Arguments] ${title} | ||
| Input Text id:titleChangeTxt ${title} | ||
| Click Button id:titleChangeBtn | ||
| Title Should Be ${title} | ||
|
|
||
| Check Handle Count | ||
| [Arguments] ${length} ${browser_alias}=${None} | ||
| @{WinCountBrowser}= Get Window Handles ${browser_alias} | ||
| ${len}= Get Length ${WinCountBrowser} | ||
| Should Be Equal As Integers ${len} ${length} | ||
|
|
||
| Check Name Count | ||
| [Arguments] ${length} ${browser_alias}=${None} | ||
| @{WinCountBrowser}= Get Window Names ${browser_alias} | ||
| ${len}= Get Length ${WinCountBrowser} | ||
| Should Be Equal As Integers ${len} ${length} | ||
|
|
||
| Check Identifiers Count | ||
| [Arguments] ${length} ${browser_alias}=${None} | ||
| @{WinCountBrowser}= Get Window Identifiers ${browser_alias} | ||
| ${len}= Get Length ${WinCountBrowser} | ||
| Should Be Equal As Integers ${len} ${length} | ||
|
|
||
| Switch Window By Location | ||
| [Arguments] ${selected_location} | ||
| @{IDs}= Get Browser Ids | ||
| :FOR ${id} IN @{IDs} | ||
| \ @{locations}= Get Locations browser=${id} | ||
| \ Run Keyword If '${selected_location}' in $locations | ||
| ... Switch Window url:${selected_location} browser=${id} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.