ruby에서 text_field의 set
메소드를 호출 할 때 텍스트는 브라우저에서 매우 느린 속도로 대략 1 문자/초로 입력됩니다.FireWatir TextField set : Very Slow
환경 정보 :
- 우분투 10.10
- 파이어 폭스 3.6.13
- JSSh 0.9
- 루비 1.9.2p136
- FireWatir 1.7.1
친절하게 조언. 미리 감사드립니다.
ruby에서 text_field의 set
메소드를 호출 할 때 텍스트는 브라우저에서 매우 느린 속도로 대략 1 문자/초로 입력됩니다.FireWatir TextField set : Very Slow
환경 정보 :
친절하게 조언. 미리 감사드립니다.
그것은 알려진 버그 : WTR-397
해결 watir-webdriver를 사용하거나 value=
대신 set
사용하는 것입니다. 예 :
browser.text_field(how => what).value= "string"
는 firewatir에 느린 키 유형의 문제를 해결할 수 : text_field.rb
폴더에 입력 한 파일을 편집 할 수
필요
#>cd /usr/lib/ruby/gems/1.8/gems/firewatir-1.7.1/lib/firewatir/elements/
그것이#>chmod 777 text_field.rb
편집 proc 디렉토리를 쓰기 가능하게 def doKeyPress(value)
@o.fireEvent("onKeyDown")
앞에 #을 넣고 @o.fireEvent("onKeyPress")
및@o.fireEvent("onKeyPress")
대신
def doKeyPress(value)
begin
max = maxlength
if (max > 0 && value.length > max)
original_value = value
value = original_value[0...max]
element.log " Supplied string is #{suppliedValue.length} chars, which exceeds the max length (#{max}) of the field. Using value: #{value}"
end
rescue
# probably a text area - so it doesnt have a max Length
end
for i in 0..value.length-1
#sleep element.typingspeed # typing speed
c = value[i,1]
#element.log " adding c.chr " + c #.chr.to_s
@o.value = "#{(@o.value.to_s + c)}" #c.chr
fire_key_events #add this
#@o.fireEvent("onKeyDown")
#@o.fireEvent("onKeyPress")
#@o.fireEvent("onKeyUp")
end
fire_key_events
지금은
더 당신이 개발자에 걸릴 수도 있습니다 FireWatir에서 벌레처럼 소리 빠르게 작동합니다 입력합니다. –