Switch between IOSDriver and RemoteWebDriver possible?
@TikhomirovSergey is already working on this.
Since Sep 19, 2017.
- Dominant language
- Java
- Stars
- 1.3k
- Forks
- 752
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 8
Description
Description
The problem
Hello again!
When I want to input data into element with IOSDriver:
IOSDriver iosd = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
iosd.get("https://google.com");
iosd.findElement(By.id("lst-ib")).sendKeys("SOME DATA HERE"); // this is input for search box inside blank google site
-I got exception: NullPointerException
But when I start driver as RemoteWebDriver:
RemoteWebDriver rwd = new RemoteWebDriver (new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
rwd.get("https://google.com");
rwd.findElement(By.id("lst-ib")).sendKeys("SOME DATA HERE");
everything looks good, box is filled with: SOME DATA HERE.
I really want to use IOSDriver to switch context from WebView to Native because further I need to use TouchAction. Need to tap on some element.
So there is a question:
Can I switch between IOSDriver and RemoteWebDriver?
What I've found out yet:
- Casting
IOSDriver iosd = (IOSDriver) new RemoteWebDriver (new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
is impossible because of exception:
org.openqa.selenium.remote.RemoteWebDriver cannot be cast to io.appium.java_client.ios.IOSDriver - Debuging:
WebElement we = iosd.findElement(By.id("lst-ib")); gives me not null element but its parent is null
but when doing the same for RemoteWebDriver
WebElement we = rwd.findElement(By.id("lst-ib")); gives me not null element with parent with many informations inside. - Page source for both drivers are the same (when checked other site there where only change with tokens data but only with that. The html tree had the same 'levels'
Environment
-Appium version (or git revision) that exhibits the issue: v1.7.0-beta
-Last Appium version that did not exhibit the issue (if applicable): --------
-Desktop OS/version used to run Appium: OS X 10.12.6 Sierra
-Node.js version (unless using Appium.app|exe): v6.11.1
-Mobile platform/version under test: iOS 10.3
-Real device or emulator/simulator: Simulator
-Appium CLI or Appium.app|exe: Appium CLI
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.