Page 1 of 1

convert string to text to use CAPTION

Posted: Thu Jul 11, 2013 10:52 pm
by tiara
Hey
I want to convert my string value to text value as i want to use caption method on it.. how can i do that in ranorex....

Re: convert string to text to use CAPTION

Posted: Fri Jul 12, 2013 2:18 pm
by Support Team
Hello,

Could you please be more specific what you want to do and why do you want to convert a string to a text value?
You can, e.g. create a Text adapter. Please read the section "Ranorex UI Adapter" or "Create Adapters to Access More Properties and Methods" in order to get more information how to create adapters in Ranorex.
Thank you!

Regards,
Bernhard

Re: convert string to text to use CAPTION

Posted: Fri Jul 12, 2013 4:37 pm
by tiara
Hey Bernhard
I read the adapter page but I am not pretty sure what is an adapter for.... can i make an adapter text to which i can pass a string such that i can use my string variable to give caption.....

My piece of code in vb.net takes is supposed to compare my backend string with the values in my repository. but when i am using
For i As Integer = 0 to arr.length-1
For j As integer = 1 to 100
Dim books As Text
books = "MyRepo.ComCompin.LeftSlideView.book"+Cstr(j)
System.console.writeline(books)
If books = arr(i) Then
System.console.writeline("Books exists")
End if



Its is giving me an error saying that " No element found for path myrepo.comcompin.leftslideview.book1 within 10 sec"

Re: convert string to text to use CAPTION

Posted: Tue Jul 16, 2013 4:37 pm
by Support Team
Hi Tiara,

It seems that you mixed up different things. A Ranorex.Text represents a Text control of your application and is not just a string. If you want to compare the text of the repo item "book" you have to compare the specific text attribute of that item with your string and not with the full object.
Could you describe in detail what you are trying to do, do you want to check if different elements of your application exist? Could you illustrate it with some screenshots?
Could you also post a Ranorex snapshot of that "book" element?
Following link will show you how to generate a snapshot file: Creating Ranorex Snapshot Files.

Thanks,
Markus