question

mallikarjunarao avatar image
mallikarjunarao asked mallikarjunarao answered

Error: command not registered

I am Making Testscript, It has 30-40 Text Fields and i want set each and every Text Field Some Value. I don't want to set each and every text field, for that i need make 40 steps. Using snap shot i get the all the textfield name, and it stored in a list. I did Field substitute the name of the text field. It gives error command not registered Details: In my example, i stored the name of text field into a temp variable

Unable to Substitute ://OWFCTextField[@name="$temp"]; 200 command @name="txtPCV24Hr" not registered. ![alt text][1] Full Image ![alt text][2] [1]: /storage/attachments/2063-CommandNotRegisteredError.jpg [2]: /storage/attachments/2064-CommandNotRegistred.jpg

iTestGUI Testing(Web-Java Swing-etc)error messagecommand
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mallikarjunarao avatar image
mallikarjunarao answered
I resolved this issue please find above my comments :) Thanks http://tclscripting.blogspot.in/
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sreekanth avatar image
sreekanth answered sreekanth posted
2 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mallikarjunarao avatar image mallikarjunarao commented ·

What is the error meaning command not registered.

0 Likes 0 ·
lakshminarayana avatar image lakshminarayana mallikarjunarao commented ·

Hi,

 

You are getting this error “command not registered” because here itest is not able to store the textfield name as temp variable.

 

Thanks

0 Likes 0 ·
msandeep avatar image
msandeep answered msandeep posted

Hi,

 

"setText" command is used to put a value in the required filed,not to rename the text field.

 

I have set the value of $temp as "bollywood" and with the setText command I set that value the textbox.

 

I am attaching screenshots for your reference.


f1.JPG (46.9 KiB)
f2.JPG (40.7 KiB)
1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mallikarjunarao avatar image mallikarjunarao commented ·

Thanks msandeep for your replay, Let me explain more clearly of my question,

 

I have 30 text field there in my form, i want insert a value in each textfield

 

ABC  Textfield1

DEF Textfield2

GHF Textfield3

......

.........

...........


ZAC Textfield33

 

The general syntax of textfield

 

://OWCTextfield[@name='nameofthetextfield]

 

now the probelm is i don't want capture 30 textfield(ABC-ZAC) and insert value into that field,  It increases my code

 

so i dont' want capture all the textfield, For that i am doing i snapshot the form, get the names of all text field by using structure and all details i store into list variable

 

snapshot

analyse

query .....@name

store listOfTextFieldNames


 

Now i doing enable field subsitution for Target Field in General (In Step properties)

 

for {set i=0} {$i < [llength $listOfTextFieldNames]} {incr i} {
                   

setText ://OWCTextField\[@name='[lindex $listOfTextFieldNames $i]'\];[lindex $listOfValues $i]

}

 

Now freely subsitute all the values, without capturing all the textfields, i did in onestep of my script.

 

If i did any mistake please let me know. 

.

My Problem was solved Thanks lakshiminarayana,srikanth and iTest :smileyhappy:


0 Likes 0 ·
sai_kiran avatar image
sai_kiran answered sai_kiran edited
There are some internal commands which can be written inside the square braces "[]". iTest by default assumes the content inside the square braces as some internal command. So, please modify the query as shown below. (Back-slash in-front of open and close sqare braces) "//OWFCTextField[@name="$temp"]" to "//OWFCTextField\\[@name="$temp"\\]"
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.