Skip to content
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

Improvements #230

Open
jefleponot opened this issue Nov 7, 2014 · 5 comments
Open

Improvements #230

jefleponot opened this issue Nov 7, 2014 · 5 comments

Comments

@jefleponot
Copy link

I have few requests for application development.

  1. The command "switchToWindow" don't work because of links text. Links haven't any target attribute. Could you please add like "switchToFrame -> switchToFrameByIndex" an index method called "switchToWindowByIndex" (or/and a "switchToWindowByTitle")?
  2. the serie of "byPass" commands is missing. Could you decline it like verify/assert/wait series?
  3. Have you planned to add digest or basic authentification popup command ? I manage this trouble using cookies commands but it is not very user-friendly for tests beginner.
  4. "acceptDownload and dismissDownload" comands could be usefull too.
  5. json data parameters file doesn't work . But it's a good idea :-)

Regards
Jef

@jefleponot
Copy link
Author

PS : my configuration - ubuntu 14.04 amd64 ff 33.0

@Zarkonnen
Copy link

  • switchToWindowByIndex/switchToWindowByTitle Sure, will have to check these are supported.
  • byPass: Can you describe what these would do?
  • digest/basic auth: Good point, again need to check what the webdriver support is.
  • acceptDownload/dismissDownload: Same
  • JSON data parameters file: Could you describe in what way it doesn't work? It does work on my machine... :)

@jefleponot
Copy link
Author

Thanks for your reply.
Here is more explanations

  1. When a new popup window is created without any name, it's impossible to use it with the switchToWindow command. AND MORE DIFFICULT TO SWITCH BACK TO PARENT WINDOW

My method for overcoming a problem, I use some "storeEval" commands to force target link
like :
{
"type": "storeEval",
"script": "document.querySelector('form').setAttribute('target','newWindow');return 1;",
"variable": "a"
},
{
"type": "storeEval",
"script": "window.name = 'parentWindow';return 1;",
"variable": "a"
},
But it is not userfriendly :-(
So we need another(s) command(s) like switchToNewWindow / switchToParentWindo / switchToWindowByTilte / switchToWindowByUrl .

it seems to be support with the wm.getMostRecentWindow("navigator:browser") function refactoring your nsCommandProcessor.searchWindows slot.

for webdriver : driver.SwitchTo().Window(driver.WindowHandles.Last());

  1. When you open a web site and the site is not fully functional but works, the browsing could be different.
    So we need a byPass command with nb_step in parameters to use another way.
    Trigger of bypassing could be the same as verify/assert/wait series.
  2. json data parameters file doesn't work . no file json is loaded.
  3. Have you plan to add Visibility tests command ? window.getComputedStyle(elem, null);
    var hidden = style.visibility === 'hidden' || style.display === 'none'; It strange to click on an unvisible div.
  4. linkText selector are really usefull .
  5. Does it only work on "A" Tag ? or also on "Button" Tag ?
  6. Why it doesn't work when there is another tag inner a "A" tag ? (example : <a><span>hello</span></a>)
  7. Somethimes we need to define the position when you find more than one link : could it be possible to specify first/last/... position by transformation in xpath selector for example:
    "//a[normalize-space(string())=="Hello"][last()]"

Regards

@jefleponot
Copy link
Author

Do you think my PR could be merge ?
If you agree , do you want I push my branch "bypass" ?

@rameshp286
Copy link

rameshp286 commented Nov 29, 2016

Hi,

Is there any update on "switchToWindowByIndex".
In my scenario both the windows having same name, So I can't use the "switchToWindow(name)"
When I try to use "switchToWindowByIndex" Its showing
Unable to Locate Window "Undefined"
switchToWindowByIndex command is exist in my Selenium sauce code, But still its not working

Guide me for this Issue

Regards,
ramesh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants