Closed Bug 1527300 Opened 5 years ago Closed 5 years ago

webElement.sendKeys(Keys.chord(Keys.CONTROL, "a"), textToSend) is not working with geckodriver

Categories

(Testing :: geckodriver, defect)

65 Branch
x86_64
Windows 10
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1494661

People

(Reporter: yashwanth.merugu, Unassigned)

References

()

Details

(Keywords: 64bit)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36

Steps to reproduce:

Once the driver is initialized with Geckodriver, navigate to the following URL's which contain input box with some default value. Here we need to clear the data in it and send text.

URL Scenario to clear and send text:
« https://stackoverflow.com/users/5081877/yash
« XPath{"//*[@id='search']/div/input"} and InputText{'mozilla'}

webElement.clear();
webElement.sendKeys(textToSend); 

Working fine on clearing it is not getting any default value.But here in the following Scenario on clearing it get some default value we need to replace the text.

URL Scenario to replace text:
« https://stackoverflow.com/users/5081877/yash
« XPath{"//input[@id='loanamount']"} and InputText{"20,00,000"}
« XPath{"//input[@id='loaninterest']"} and InputText{"10"}
« XPath{"//input[@id='loanterm']"} and InputText{"15"}

//webElement.clear();
webElement.sendKeys(Keys.chord(Keys.CONTROL, "a"), textToSend); // Keys.COMMAND - MAC

Here the above code is working in old firefox browser but not working with GeckoDriver.

os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'.
browserName: firefox, browserVersion: 65.0, moz:geckodriverVersion: 0.24.0

Actual results:

Actual is it is selecting the text but not replacing.

Expected results:

It should replace the text.

URL Scenario to replace text: https://emicalculator.net/

Keywords: 64bit
OS: Unspecified → Windows 10
Priority: -- → P2
Hardware: Unspecified → x86_64

Hi, Yashwanth, since you're reporting a Geckodriver issue, I moved the bug there. Priorities are set by the contributors who take on the bugs, so I unset that. Thanks for reporting this!

Component: Untriaged → geckodriver
Priority: P2 → --
Product: Firefox → Testing

Please attach a trace log when running your test. Details in how to do it can be found here:
https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/TraceLogs.html

Also a short code snippet would be great.

Flags: needinfo?(yashwanth.merugu)

As identified on https://github.com/mozilla/geckodriver/issues/1502 the test uses Keys.chord() which uses the NULL character to reset the pressed modifier key.

So this is dupe of bug 1494661.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(yashwanth.merugu)
Resolution: --- → DUPLICATE

Hi whimboo.

I have observed that you have duplicated the bug. Here i am not saying that "WebDriver:ElementSendKeys" has to support "NULL" key it is different he is passing the null value. Where as i am passing value you can observe form the trace. Both Bugs are different from each other.

------------- sendKeys(null)

webdriver::server	DEBUG	-> POST /session/SESSION-ID/element/ELEMENT-ID/value {"id":"ELEMENT-ID","text":"null","value":["n","u","l","l"]}
Marionette	DEBUG	0 -> [0,6,"WebDriver:ElementSendKeys",{"id":"ELEMENT-ID","text":"null","value":["n","u","l","l"]}]
Marionette	DEBUG	0 <- [1,6,null,{"value":null}]
webdriver::server	DEBUG	<- 200 OK {"value":null}

------------- sendKeys(Keys.chord(Keys.META, "a"), "20,00,000")

webdriver::server	DEBUG	-> POST /session/SESSION-ID/element/ELEMENT-ID/value {"id":"ELEMENT-ID","text":"a20,00,000","value":["","a","","2","0",",","0","0",",","0","0","0"]}
Marionette	DEBUG	0 -> [0,6,"WebDriver:ElementSendKeys",{"id":"ELEMENT-ID","text":"a20,00,000","value":["","a","","2","0",",","0","0",",","0","0","0"]}]
Marionette	DEBUG	0 <- [1,6,null,{"value":null}]
webdriver::server	DEBUG	<- 200 OK {"value":null}

--------------- sendKeys(Keys.chord(Keys.META, "a"), null)

webdriver::server	DEBUG	-> POST /session/SESSION-ID/element/ELEMENT-ID/value {"id":"ELEMENT-ID","text":"anull","value":["","a","","n","u","l","l"]}
Marionette	DEBUG	0 -> [0,10,"WebDriver:ElementSendKeys",{"id":"ELEMENT-ID","text":"anull","value":["","a","","n","u","l","l"]}]
Marionette	DEBUG	0 <- [1,10,null,{"value":null}]
webdriver::server	DEBUG	<- 200 OK {"value":null}
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---

No, this is a dupe. As I said Key.chords is using Keys.NULL - which is NOT null- to reset the modifier state. That is not supported right now due to bug 1494661.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.