driver.find_element sendkeys issue

66 views
Skip to first unread message

Larry Brown

unread,
Dec 9, 2014, 12:40:04 PM12/9/14
to seleniu...@googlegroups.com

I have a situation where the driver.find_element(:id, “sometext” ).send_keys method is not entering the expected data or else it is being ignored entirely. I am using Ruby with Selenium test::unit.

 

Example:

In the code below the first two lines find the unit price field, clears it and then enters “100.00” in that field. In the second one the same behavior should enter “150.00” in the Broker Commission field but instead “0.1” gets entered instead and then the third one, which is the Shipping Fee field is completely ignored.

I have tried to do this using :id, :name and also :xpath with similar results. Note that there are several other fields on the same page that enter the correct amounts using the same methods, but for these two I am unable to get it to work. Why would it vary for these two fields only? I don't have a sample page I can direct folks to unfortunately.

 

    @driver.find_element(:id, "frmfldUnitPrice2").clear

    @driver.find_element(:id, "frmfldUnitPrice2").send_keys "100.00"

    @driver.find_element(:id, "txtBrokerCommission").clear

    @driver.find_element(:id, "txtBrokerCommission").send_keys "150"

    @driver.find_element(:id, "txtShippingFee").clear

    @driver.find_element(:id, "txtShippingFee").send_keys "100"

PeterJeffreyGale

unread,
Dec 9, 2014, 12:44:45 PM12/9/14
to seleniu...@googlegroups.com
Is there any javascript on th epage that is triggered from input to these fields?

rashmis...@gmail.com

unread,
Dec 9, 2014, 12:59:26 PM12/9/14
to seleniu...@googlegroups.com
TestNG] Reporter org.uncommons.reportng.HTMLReporter@16392c27 failed
org.uncommons.reportng.ReportNGException: Failed generating HTML report.
    at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:118)
    at org.testng.TestNG.generateReports(TestNG.java:1115)
    at org.testng.TestNG.run(TestNG.java:1074)
    at com.ericsson.edosdp.testing.automation.framework.testNG.TestNGConfiguratorAndRunner.run(TestNGConfiguratorAndRunner.java:133)
    at com.ericsson.edosdp.testing.automation.EDOSDPAutomation.main(EDOSDPAutomation.java:471)
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getUser' in  class org.uncommons.reportng.ReportMetadata threw exception class java.net.UnknownHostException : PGGN905.egi.ericsson.com: PGGN905.egi.ericsson.com: Name or service not known
    at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:193)
    at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
    at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:220)
    at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
    at org.apache.velocity.Template.merge(Template.java:256)
    at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:449)
    at org.uncommons.reportng.AbstractReporter.generateFile(AbstractReporter.java:108)
    at org.uncommons.reportng.HTMLReporter.createOverview(HTMLReporter.java:142)
    at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:107)
    ... 4 more
Performance Logger Shutting Down ...

Can any one faced this issue?
can any one tell me why i am getting this exception.


Krishnan Mahadevan

unread,
Dec 10, 2014, 3:59:42 AM12/10/14
to Selenium Users
This problem doesnt seem to have anything to do with Selenium.

Looking at your stacktrace, it seems to be more of a problem in your test repo [ something is referring to a host named  PGGN905.egi.ericsson.com ] which is not getting resolved. Could it be your test environment ?


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/983f6ec6-24fc-449b-9a5a-0f0f72a3edff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages