lihua
New Member
Posts: 8
|
Post by lihua on Sept 8, 2015 1:43:29 GMT
In my [ed. SeleniumPlus] test case, I have below three statements. The last two statements are executed before the first statement "EditBox.SetTextValue" is finished. And that cause the statement "EditBox.SetTextValue" failed. EditBox.SetTextValue(MyTextBox, quote("This is very long stringThis is very long stringThis isvery long stringThis is very long string.")); Component.InputKeys(MyTextBox, "{End}"); Component.InputKeys(MyTextBox, "{End}{BackSpace}"); **FAILED**无法完成 SetTextValue., EnterTopic EditBox verify errors: property:'This is very long stringThis is very long stringThis isvery long stringThis is very long string' NOT equals value:'This is very long stringThis is very long stringThis isvery long stringThis is very long string.' And I have to insert "Pause(2)" after the first statement to execute all of them successfully.
|
|
|
Post by leiwang on Sept 9, 2015 2:34:06 GMT
This is very strange. I believe the methods are executed sequentially. Could you provide me the debug log? Send it to my mail box if it contains confidential information.
|
|
|
Post by sascanagl on Sept 9, 2015 14:40:59 GMT
A good test scenario might be simply to use Google. We can use SetTextValue of some long strings, and even play with changes to delay between keystrokes to see if that has any impact. If this truly does occur, then it is likely the longer the SetTextValue string is, the more likely it will be to reproduce the problem.
|
|
|
Post by sascanagl on Sept 9, 2015 15:14:27 GMT
I have just created such a test and could not duplicate the problem. I sent a very long string to the Google search box with varying delays of up to 25ms per character. The SetTextValue call took up to 37 seconds to execute by itself, and the subsequent InputKeys did NOT execute until after SetTextValue was finished.
<LOG_MESSAGE type='GENERIC' date='09-09-2015' time='11:09:13' > <MESSAGE_TEXT><![CDATA[pause 1 successful.]]></MESSAGE_TEXT> </LOG_MESSAGE> <LOG_MESSAGE type='PASSED' date='09-09-2015' time='11:09:50' > <MESSAGE_TEXT><![CDATA[SetTextValue verifying successful.]]></MESSAGE_TEXT> </LOG_MESSAGE> <LOG_MESSAGE type='PASSED' date='09-09-2015' time='11:09:57' > <MESSAGE_TEXT><![CDATA[Google:Search InputKeys successful using {End}{BackSpace}]]></MESSAGE_TEXT> </LOG_MESSAGE>
|
|
|
Post by sascanagl on Sept 10, 2015 13:57:57 GMT
Well...I think I have found something of interest. Not exactly as originally reported, but oddly similar.
The test I ran yesterday used Chrome. No failure. But I only ran it once.
I ran the same test today on Internet Explorer and I got a verification failure. Again, it was a period (.) missing. But not at the end of the text. It was near the beginning. The InputKeys command still did NOT run until AFTER SetTextValue was completed and it removed the period (.) at the end of the input as expected AFTER the SetTextValue verification was attempted.
So it would seem the browser may on rare occassions miss getting a typed character--even when there is a 25ms delay between keystrokes!
|
|
|
Post by leiwang on Sept 16, 2015 8:34:27 GMT
Indeed, with IE it is easy to reproduce this problem. But with our Robot, I test a lot of time, it never fail to input the "long string" to the focused Google search box (the browser is started manually). I found another problem, the whole string are set correctly in the edit box, but our code verifies the content too quicklyl before the browser react to the input, which means the HTML tag's property has not been fully set. But for the missing character, I still cannot get the reason.
|
|
|
Post by leiwang on Dec 3, 2015 8:41:15 GMT
I add a method Robot.testInputKeys() to test 'input keys' in different browsers, I found that if the browser (IE, Firefox, Chrome) is started manually, then 'input keys' will hardly fail; If the browser is started by selenium-server, for Chrome and Firefox, 'input keys' works quite well, BUT for IE 'input keys' will miss characters sometimes. To start IE by Selenium, 1. Start the selenium-standalone-server 2. Visit page http://127.0.0.1:4444/wd/hub/ 3. Click "Create Session", and choose browser as "Internet explorer" To run the test, 1. Visit page www.google.com in the selenium-started IE 2. Run org.safs.robot.Robot 3. Within 5 seconds, Click the 'Search Box' in Google page Then we can see that robot will input a long string to that 'Search Box' again and again until it fail. Turn on the switch 'waitReaction' will help a little, but will not eliminate the 'missing character problem'.
|
|
|
Post by leiwang on Dec 3, 2015 8:46:02 GMT
A workaround, we can make a loop to input keys until it succeed.
|
|
|
Post by leiwang on Dec 16, 2015 6:07:10 GMT
I incorporated the workaround into our code, so this problem should have been fixed :-)
|
|