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

GetSize() and WebDriverWait . Can we have support for this two? #68

Closed
KonyLabs opened this issue Mar 3, 2016 · 23 comments
Closed

GetSize() and WebDriverWait . Can we have support for this two? #68

KonyLabs opened this issue Mar 3, 2016 · 23 comments

Comments

@KonyLabs
Copy link

KonyLabs commented Mar 3, 2016

Currently it doesn't have support to get the size of an element.
And if we want to wait for an element to appear, that is also not there.
Can you please provide support for these two ?

@NickAb
Copy link
Contributor

NickAb commented Mar 3, 2016

We can back port GetSize from Winium.StoreApps. But I am not sure what you mean by WebDriverWait support. Waiting is implemented on client side and it should work out the box, did you get an exception while using wait? Can you provide an example to reproduce?

@KonyLabs
Copy link
Author

KonyLabs commented Mar 3, 2016

Just Found Out elementToBeClickable wont work but visibilityOfElementLocated will work. I guess that would be fine for me.
But i need getSize() functionality badly.
And i ran into one other issue. If i execute sendKeys on password TextBox, send keys fails saying "Element referenced is not of control type". What to do in this case?

@NickAb
Copy link
Contributor

NickAb commented Mar 3, 2016

Are you sure you pass correct locator? What version of driver do you use: 0.2.0 or master?

We had an issue about PasswordBox and it was fixed before 0.2.0, see #46

Can you reproduce it on test app with password field only or can you provide page source and driver logs?

@KonyLabs
Copy link
Author

KonyLabs commented Mar 4, 2016

Yeah the locator is correct and am using 0.2.0.* driver.
And as i am getting "Element referenced is not of control type" is error which you have modified in #46 . So i guess i am on latest branch.
The driver logs throws this :
screen shot 2016-03-04 at 10 33 07 am

Attaching Page Source :
screen shot 2016-03-04 at 10 39 21 am

@KonyLabs
Copy link
Author

KonyLabs commented Mar 4, 2016

Few Gestures request, can we have tapAtLocation feature through TouchAction or JavaScript Executor.
DoubleTap also throws error (using TouchActions).

@NickAb
Copy link
Contributor

NickAb commented Mar 4, 2016

The error message comes from ValueCommand.cs#L28 meaning that the element that you are referencing is not of a control type. The UI tree screenshot shows that the password box has correct type of System.Windows.Controls.PasswordBox, which is a descendant of Control class.

Can you please provide a code of the part of test case where you locate the element?
Please do remember that the code can contain sensitive info as your are dealing with passwordbox, so make sure to replace sensitive info with some random data and marking.

@NickAb
Copy link
Contributor

NickAb commented Mar 4, 2016

For tapAtLocation you can use move and click commands combinations. In python this can be achieved using ActionChains. I am not sure if it still supported in javascript bindings.

I am referring to https://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_/session/:sessionId/moveto and https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/click commands.

@NickAb
Copy link
Contributor

NickAb commented Mar 9, 2016

@KonyLabs please try #69 for GetElementSize and GetElementRect support

@KonyLabs
Copy link
Author

Is there any way to know the size of an Element from getPageSource() ? If not then,how is it calculated ?

@NickAb
Copy link
Contributor

NickAb commented Mar 14, 2016

No, it is not included into page source. You can ask for elements rect or size using selenium commands.
First, locate element using FindElement or FindElements, then call Size or Rect commands on element.

element.ActualWidth and element.ActualHeight are used to calculate the size.

Make sure to use both Outer and Inner drivers built from source of PR #69

@KonyLabs
Copy link
Author

Yeah i am able to get Size and all but was just wondering how is it calculated or can we find it in GetpageSource().

@NickAb
Copy link
Contributor

NickAb commented Mar 14, 2016

I will add it some time later. This and next weeks are going to be busy.

@KonyLabs
Copy link
Author

Regarding Gestures, i am not able to tap at location using anything.
Your way of clicking i.e by move_to_element then click. But i don't have any element. I just want to click at particular location without any element availaible, just like Appium and Selenium i.e TouchAction/JavaScriptExecutor.

I guess the only way left now is to perform it through JavaScript Executor ?

@NickAb
Copy link
Contributor

NickAb commented Mar 16, 2016

Have you tried move_by_offset from Action Chains? It does not require element and lets you move from top left corner of the screen.

In first comment in issue #67 you can see that sleekweasel uses exactly move_by to click at specified screen location, no element required.

@KonyLabs
Copy link
Author

Yeah i tried that one too, didnt work.
screen shot 2016-03-16 at 6 07 36 pm

Throws Not implemented: touchMove , while operating move().

@NickAb
Copy link
Contributor

NickAb commented Mar 17, 2016

Use Action Chain instead of Touch Actions. What langue do you use to write tests?

@KonyLabs
Copy link
Author

I use Java. And Actions Chain is for Python i guess.

@NickAb
Copy link
Contributor

NickAb commented Mar 17, 2016

Please see https://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/interactions/Actions.html

Something like this should work, hopefully

Actions action = new Actions(web driver);
action.moveByOffset(x, y).click().build().perform();

@KonyLabs
Copy link
Author

Actions looks helpful . Thanks :)

@KonyLabs
Copy link
Author

Nick, when i am trying to swipe on swipable screen(Not Scrollable) . None of the Actions/TouchActions seems to be working. Is swipable screen a special case ?
I'll provide the case :
This is how screen looks
screen shot 2016-03-22 at 2 27 33 pm

After performing swipeDown it should look like
screen shot 2016-03-22 at 2 27 44 pm

But the commands performing no swipe Operation as screens not changing on performing scroll/moveByoffset.

@NickAb
Copy link
Contributor

NickAb commented Mar 28, 2016

Can you try simpler operation, like a plain click on a button first to make sure that you have actions working?

@KonyLabs
Copy link
Author

KonyLabs commented Apr 5, 2016

The actions are working fine for other cases of same App. Its just the swipe which is not working.

@NickAb NickAb closed this as completed Jul 31, 2016
@NickAb
Copy link
Contributor

NickAb commented Jul 31, 2016

If you still experience problems with swiping, please open a new issue, preferable with minimal test app to reproduce. Because we used swiping in our app, that we test, without problems.

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

No branches or pull requests

2 participants