Password field code is:
driver.findElement(By.xpath("//XCUIElementTypeSecureTextField[@value=‘Password’]")).click();
((IOSDriver)driver).hideKeyboard();
driver.findElement(By.xpath("//XCUIElementTypeSecureTextField[@value=‘Password’]")).sendKeys(“raks”);
[JSONWP Proxy] Got response with status 200: {“value”:{“using”:“xpath”,“value”:"//XCUIElementTypeTextField[@value=‘Email’]",“description”:“unable to find an element”},“sessionId”:“A5A83E8A-D223-4831-A0ED-38BCBEE93BCE”,“status”:7}
[BaseDriver] Waited for 55942 ms so far
[JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8100/session/A5A83E8A-D223-4831-A0ED-38BCBEE93BCE/element] with body: {“using”:“xpath”,“value”:"//XCUIElementTypeTextField[@value=‘Email’]"}
[JSONWP Proxy] Got response with status 200: {“value”:{“using”:“xpath”,“value”:"//XCUIElementTypeTextField[@value=‘Email’]",“description”:“unable to find an element”},“sessionId”:“A5A83E8A-D223-4831-A0ED-38BCBEE93BCE”,“status”:7}
[BaseDriver] Waited for 57490 ms so far
try this and let me know if its working
By.xpath("//XCUIElementTypeOther/XCUIElementTypeTextField/XCUIElementTypeTextField")).sendKeys(“test”);
By.xpath("//XCUIElementTypeOther/XCUIElementTypeSecureTextField/XCUIElementTypeSecureTextField")).sendKeys(“raks”);
Hey karunakar, Use IOS driver type cast for entire test case not just for hidekeyboard.
mens
//means some where above where you are declaring the actual driver there itself do the type cast, then only element identification on IOS applies for every step.
//Not sure what code you have at driver delcartion, but make sure u typecast with IOS driver. some thing like
somedriver = (IOSDriver< WebElement >)driver;
Actually i have mentioned like this.
IOSDriver driver = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”),capabilities);
Now what should i change in code. @kumarsiva
That is fine, can you try once by giving 10 seconds wait before to Email click action. or alternatively interchange the steps of email and password up and down try again, let see any time lag is there before loading of all elements on screen
Changed the thread sleep count, Event its displaying the same error.
Password field is working fine with the above code but am not able to enter the text in email id field. i don’t know the exact reason for that…
Please check the above mentioned code and correct me if anything wrong. @kumarsiva
If i use this below line its displaying error like:
Code: AppiumdDriver< WebElement> driver = new IOSDriver< WebElement>(new URL(“http://127.0.0.1:4723/wd/hub”),capabilities);
Error:
The Type AppiumDriver is not generic: it can not be parameterized with arguments
The Type IOSDriver is not generic: it can not be parameterized with arguments
NoteL I think this issue is because of the attached java client. Currently am using java-client-2.1.0.jar. Please look into this and give me the solution.
Yup that could be the reason, you can use latest version of java-client 4.1.1. Even after upgrading java-client, still if it is not working then alternatively you can try the below code in identifying Email. As you said password field is detecting fine, you can try to give below xpath for email field
I found this error after changing the java client to 4.1.1 Multiple markers at this line - The type org.openqa.selenium.remote.service.DriverService$Builder cannot be resolved. It is indirectly referenced from required .class files - The type org.openqa.selenium.remote.http.HttpClient$Factory cannot be resolved. It is indirectly referenced from required .class files