Error getting on Appium, Cannot set the element to 'value'. Did you interact with the correct element? - android-emulator

I am doing automation of the app using appium. I am able to lunch the app but I go for login, it can read the XPath for login. But appium is unable to enter the mobile number. For mobile device, I am using the emulator.
This is my code:
driver.findElement(By.xpath(props.getProperty("mobile"))).sendKeys("123456");
This is my Xpath:
mobile=//android.widget.EditText[#text='Mobile']
Error facing:
Encountered internal error running command: io.appium.uiautomator2.common.exceptions.InvalidElementStateException: Cannot set the element to 'value'. Did you interact with the correct element?

Not sure why you have the props.getProporty in there or what you trying to do with that, you can just use the xpath right in the driver.findElement()
driver.findElement(By.xpath("//android.widget.EditText[#text='Mobile']")).sendKeys("123456");

In UIAutomator2 mode, if the element is not an editText, can‘t use sendKeys()/setValue()
Can user driver.pressKey(KeyEvent(AndroidKey.A)) instead

The field you are trying to access should be of editText to accept input keys. if you are getting parent element of the editText, there is a chance that you are trying to sendKeys to a layout field than actual element. Inspect the element retrieved in the Appium Desktop session

Related

Couldn't perform click, button not found in: 'click on "OBFormFieldSelectInputRequired"'

Recently, I registered with Testrigor and am using its Free version. We need to test dynamic web applications in Testrigor, then we write scripts for the same. In our Application 3 field use same class selector ,so when i used class in script for enter value in that class but that time Test rigor entered value in another field because of same class,i was try to resolve issue using Name And id Locator but Issue not Solved.
I am getting the following error in one field .
Couldn't perform click, button not found in: 'click on "OBFormFieldSelectInputRequired"'.
Please check attached screenshot.
I'm Tried with Name And Id locator

Cannot insert duplicate key row in object dbo.durados_UserSocial

I'm testing backand platform and got this error
http://localhost:8100/?ionicplatform=ios&error=%7B%22message%22:%22Cannot%20insert%20duplicate%20key%20row%20in%20object%20%27dbo.durados_UserSocial%27%20with%20unique%20index%20%27IX_durados_UserSocial_UserId_Provider%27.%20The%20duplicate%20key%20value%20is%20(387068,%20facebook).%0D%0AThe%20statement%20has%20been%20terminated.%22,%22provider%22:%22facebook%22%7D#/tabs/dashboard
This is a project started from http://market.ionic.io/starters/ionic-backand-with-social according to Getting started mobile.
I couldn't get any match on google
I think it could be because I'm logging in with the same account that I created the app in backand, however, shouldn't it be possible to just make a login instead of try to register it (or whatever it's trying to do)?
This worked with project default keys for facebook.

How to avoid loss of driver object?

i am trying to migrate our test automation from watir-classic to watir-webdriver. (Ruby 2.0, watir-webdriver 0.9.1)
Which is working fine in general, but our login process gives me a headache.
Lets me short explain what happens:
Open Website A
Enter login credentials and press login button.
Website B is opened with the actual content while Website A is closed.
With the closing of Website A, the driver is also lost, i currently i cannot make a new instance of the driver to connect to the Website B.
when i try to do create an instance of the following pageobject, i get :
variable name="#exception" kind="instance" value="Unable to get
browser" type="Selenium::WebDriver::Error::NoSuchWindowError"
I do this by:
def click_loginbtn
##driver.button(id: 'loginBtn').click
return ProjectList.new(##driver)
end
Has anyone a good idea for this?
Your driver is still active, you just need to access the new window.
To get a list of active windows available:
#browser.windows
You can switch to another window by handle, title, url, index or collection
#browser.window(title: 'My new window').use
#browser.windows.first.use

How to call SOAP service from Phonegap (iPhone app)

I am trying to call a SOAP service using this SOAP client but it is not working for me. Please help me. How can I send and receive XML SOAP with Phonegap?
Phonegap is HTML/JS/CSS commonly communicating via XHR/Ajax. It's better to use jQuery Ajax functions. You can get the details here.
Eg:
Posting-XML-SOAP-Requests
AJAX-Requests-Between-jQuery
Simple jQuery client to call a SOAP web service
If you find any cross-domain issues (or working in a browser and not working with simulator/device), please refer to the below steps.
Go to the Resources folder, you can see a file named Cordova.plist. Click on that and you can see the Root elements. Right click on the Root, add a row, set the key as ExternalHosts with type Array.
Expand the item, and add an item as item0. Give it type string and enter the value as '*'.
Don't forget to save the Cordova.plist after changes (just use cmd+s).

Getting REQUEST_DENIED when calling Google's Autocomplete from a Browser

I have signed up for Google Places Autocomplete API and created a new key by going to following url.
http://code.google.com/apis/console/
I am using the generated key to do some testing on my browser. I am entering following url to search for City names starting with "San".
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=San&types=cities&sensor=false&key=
I keep getting "REQUEST_DENIED" error message. Is there anything I am missing? I can see my usage counter going up every time I try to test this using a browser, but I keep getting REQUEST_DENIED message back. As per the google documentation it says this message is related to "Sensor" parameter. I tried setting this parameter to True/False but get the same results. Please help!
Thanks,