Ask a Question

Enter a text into textbox

kaiiii
Regular Contributor

Enter a text into textbox

Here's a sample of code below:

 

Set Sell_currency =  Mobile.Device("Q3000").Process("com.cor.currency").Layout("NO_ID").Layout("action_bar_root").Layout("content").View("drawer_layout").ScrollView("homeScrollView").Layout("NO_ID").Layout("NO_ID", 2).Layout("sample2").Layout("NO_ID", 2).Layout("NO_ID").Layout("NO_ID").Layout("NO_ID").TextView("textYouSend")

Sell_currency.Click

Sell_currency.SetText(Project.variable.Currency("Amount"))

but it's not entering the text into text box.....also got there SetText_2 to SetText_8 types property...I don't know what's the difference between them and when we will use it

13 REPLIES 13
baxatob
Community Hero

1. Sell_currency.Click <--- don't you forgot the parenthesis? 

2. Try Keys() method instead of SetText()

kaiiii
Regular Contributor

I am using Vb script. for Click method, i think parenthesis() are optional. I did it several times and faced no issue.

 

Yes.. i tried to used Keys instead of SetText() but it doesn't work

AlexKaras
Champion Level 3

Hi,

 

> i tried to used Keys instead of SetText() but it doesn't work

Any more details as for what 'doesn't work' means?

-- Nothing is entered into control?

-- Error is posted to test log?

-- Text is entered but seems to be not recognized by the control?

-- Some other problem?

 

To be on the safe side: have you checked in the debugger that the correct expected control is addressed, that the control exists and that test code attempts to enter correct value into control?

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
kaiiii
Regular Contributor

Hi,

When u used Keys instead of SetText, then none error shows in the test log but
- Nothing is entered into control?

AlexKaras
Champion Level 3

Hi,

 

Can you post the relevant code here?
Did you focus the control before calling .Keys() for it?

E.g. like this:

control.Touch()

control.Keys("aaa")

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
kaiiii
Regular Contributor

Set Sell_Amount = Mobile.Device("Q3000").Process("com.cor.currencydirect").Layout("NO_ID").Layout("action_bar_root").Layout("content").View("drawer_layout").ScrollView("homeScrollView").Layout("NO_ID").Layout("NO_ID", 2).Layout("sample2").Layout("NO_ID", 2).Layout("NO_ID").Layout("NO_ID").Layout("NO_ID").EditText("editAmtYouSend")
Sell_Amount.Click
Delay(1000)
Sell_Amount.Keys(Amount)
Mobile.Device.Keys("[Done]")

 

In the above code,
i also tried to use, SetText but problem doesn't solve

Marsha_R
Champion Level 3

Are you sure that Amount 1) actually has a value in it  2) the value is of the proper type?  Those are other reasons that the value might not be entered.

kaiiii
Regular Contributor

yes, i am sure

 

AlexKaras
Champion Level 3

Hi,

 

> Sell_Amount.Click

While the documentation states that .Click() is equivalent to .Touch() for mobile devices, could you try .Touch() and check if the behavior is the same.

Also, I would expect that after .Touch() / .Click() the virtual keyboard should be displayed and you should be able to see it while the Delay(). Is virtual keyboard displayed?

All at all, are there any specifics for this problematic control when interacting with it manually? Can you contact developers and ask them whether this is regular standard control or customized one?

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: