szquadri / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

solo.clickOnText finds the required text but treats it as a different text #650

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Have a TextView with text= "Weekly (default)"
2.Try to click on it using solo.clickOnText(text, 0, true);

What is the expected output? What do you see instead?
Expected: the TextView is clicked.
Actual:
junit.framework.AssertionFailedError: Text string: 'Weekly (default)' is not 
found!

What version of the product are you using? On what operating system?
robotium 5.2.1, windows 7, java 7

Please provide any additional information below.
as appears below the text is actually found by solo but is classified as a 
different text. i guess that it is a bug that has sometinhg to do with the 
bracket signs which probably affect the regex trying to match the text.
cheers,
Gil.

Stack trace (and few of the logcat lines):

01-19 13:22:13.045 D/Robotium( 6857): 'Weekly (default)' not found. Have found: 
'Notification Frequency'

01-19 13:22:13.045 D/Robotium( 6857): 'Weekly (default)' not found. Have found: 
'Daily'

01-19 13:22:13.045 D/Robotium( 6857): 'Weekly (default)' not found. Have found: 
'Weekly (default)'

01-19 13:22:13.045 D/Robotium( 6857): 'Weekly (default)' not found. Have found: 
'Every 2 weeks'

01-19 13:22:13.045 D/Robotium( 6857): 'Weekly (default)' not found. Have found: 
'Monthly'

01-19 13:22:13.045 D/Robotium( 6857): 'Weekly (default)' not found. Have found: 
'Never'

01-19 13:22:13.045 E/RobotiumExecutorCleaner( 6857): Exception caught

01-19 13:22:13.045 E/RobotiumExecutorCleaner( 6857): Stack trace:

01-19 13:22:13.045 E/RobotiumExecutorCleaner( 6857): 
junit.framework.AssertionFailedError: Text string: 'Weekly (default)' is not 
found!

01-19 13:22:13.045 E/RobotiumExecutorCleaner( 6857):    at 
junit.framework.Assert.fail(Assert.java:50)

01-19 13:22:13.045 E/RobotiumExecutorCleaner( 6857):    at 
com.robotium.solo.Clicker.clickOnText(Clicker.java:447)

01-19 13:22:13.045 E/RobotiumExecutorCleaner( 6857):    at 
com.robotium.solo.Solo.clickOnText(Solo.java:1118)

01-19 13:22:13.045 E/RobotiumExecutorCleaner( 6857):    at 
org.topq.mobile.server.impl.soloexecutor.SoloExecutor.clickOnText(SoloExecutor.j
ava:2293)

Original issue reported on code.google.com by gil.ujfa...@gmail.com on 19 Jan 2015 at 2:34

GoogleCodeExporter commented 9 years ago
This is due to the regex support in Robotium. Please use Pattern.qoute("text") 
to bypass it. 

Original comment by renasr...@gmail.com on 21 Jan 2015 at 8:21

GoogleCodeExporter commented 9 years ago
thanks

Original comment by gil.ujfa...@gmail.com on 21 Jan 2015 at 8:43