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

Test a website in mobile browser #25

Open
sunit82 opened this issue Aug 8, 2016 · 1 comment
Open

Test a website in mobile browser #25

sunit82 opened this issue Aug 8, 2016 · 1 comment

Comments

@sunit82
Copy link

sunit82 commented Aug 8, 2016

I want to test a website in windows browser (IE or any other installed browser) in emulator or device.
So for this I wan't to know how to start the IE which is installed by default in windows emulator or device.
Through winium we are always asked to provide "app" capability which is mandatory to start Remote driver. But since we are trying to start the inbuild browser we don't have a appx\appxbundle file path to provide as "app" capability. Can anyone share a sample code for the same pls. Thanx.

@NickAb
Copy link
Contributor

NickAb commented Aug 15, 2016

If you want to test website in Windows Phone browser, then I would suggest you to use https://github.com/forcedotcom/windowsphonedriver which is a Selenium driver for Windows Phone. It uses an app with WebView in it, that acts just like standard browser on Windows Phone. All or almost all features of selenium will work as expected.

If you would like to stick to CodedUI, note that a limited subset of commands is implemented yet, searching by css selectors or xpath will not work, some elements might not have id or class as the Winium does not interact with WebView directly and does not distinguish web elements from native elements, all of this is done by Microsoft Automation libs which have their own logic on how to map web elements to Automation elements.

Actually you can skip app capability, to do so, do not specify it at all, or set it to null or empty string. You would be able to open preinstalled apps using something like (in python) self.driver.switch_to.window(TILE_ID). If I remember correctly TILE_ID can be obtained from result of executing page_source command while start screen is open on the emulator or device. TILE_ID is automation id attribute of corresponding tile. See samples for example on how to run automation script against preinstalled calculator https://github.com/2gis/Winium.StoreApps.CodedUi/blob/master/TestExamples/test_sample.py#L92

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