Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Check field and submit button not working on Android 2.3.3 #2691

Closed
lukeis opened this issue Mar 3, 2016 · 6 comments
Closed

Check field and submit button not working on Android 2.3.3 #2691

lukeis opened this issue Mar 3, 2016 · 6 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 3, 2016

Originally reported on Google Code with ID 2691

Before filing an issue, please read the page at
http://code.google.com/p/selenium/wiki/SeleniumHelp This contains lot of
information about how best to get help, and tells you what we need to know.

Still here? We know that bugs are frustrating and annoying things. We also
know that you've probably spent ages trying to figure out what's wrong. The
more information you give us now, the more likely it is that we'll be able
to help.

What steps will reproduce the problem?
1.Suppose you want to check a field/option by clicking on it. I tried doing it with
xpath as follows :

// Is this a checkbox, radio button or select list?
         WebElement we = driver.findElement(By
              .xpath(".//input[@type='checkbox'][@name='" + name + "'][@value='"
                  + value + "'] | .//input[@type='radio'][@name='" + name
                  + "'] | .//select[@name='" + name + "']/option[@value='" + value
                  + "']"));
          we.click();
2. The click doesn't happen. Also, when I want to press the submit button on the same
page, I do this :
WebElement we = driver.findElement(By.name(fieldName));
we.submit();

where, fieldname is "submit". Here is the corresponding html of the page :

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<script type="text/javascript">

function initForm(oForm) 
{
  browser = oForm.elements["browser"];
  browser.value = navigator.userAgent;
  platform = oForm.elements["platform"];
  platform.value = navigator.platform;
}

</script>

<title>BenchLab Client Login</title>
</head>
<body onload="initForm(document.forms[0]);">

<h1>Client Browser Registration</h1>


<br/>

<form name="input" action="ClientLoginPost" method="post">
Client IP Address: <input type="text" name="ipAddress" value="192.168.245.44" /><br
/>
Client port: <input type="text" name="port" value="39123" /><br />
Browser type: <input type="text" name="browser" size="120"/><br />
Platform: <input type="text" name="platform"/><br />
Region: <input type="text" name="region" value="Unknown"/><br />
BenchLab version: <input type="text" name="benchlabVersion" value="0.0" size="10"/><br
/>
Polling period in seconds: <input type="text" name="pollingInSec" value="10" size="5"/><br
/>
Supported features:<br/>
<input type="checkbox" name="feature" value="harTrace">Traces in HAR format<br/>
<input type="checkbox" name="feature" value="harResult">Results in HAR format<br/>
<input type="checkbox" name="feature" value="csvTrace">Traces in CSV format<br/>
<input type="checkbox" name="feature" value="csvResult">Results in CSV format<br/>
<input type="checkbox" name="feature" value="htmlRecord">HTML recording<br/>
<input type="checkbox" name="feature" value="screenSnapshots">Screen snapshots<br/>
Local storage space in MB:<input type="text" name="storageInMB"/><br />
<input type="submit" name="submit" value="Submit" />
</form> 
</body>
</html>

The page can be accessed as follows : http://obelix.cs.umass.edu:8089/BenchLab-WebApp/..

I expect the radio buttons to get clicked. From logcat, I see this :

...
...
...
...
I/AndroidDriverServlet(11123): Executing: [find element: By.xpath: .//input[@type='checkbox'][@name='feature'][@value='csvResult']
| .//input[@type='radio'][@name='feature'] | .//select[@name='feature']/option[@value='csvResult']]
at URL: /session/1319144695320/element)
D/dalvikvm(11123): GC_CONCURRENT freed 1548K, 43% free 5793K/10119K, external 2034K/2137K,
paused 4ms+3ms
I/AndroidDriverServlet(11123): Done: /session/1319144695320/element
I/AndroidDriverServlet(11123): Executing: [click: 3 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@bdad8f09]
at URL: /session/1319144695320/element/3/click)
D/dalvikvm(11123): GC_FOR_MALLOC freed 1066K, 42% free 5904K/10119K, external 2034K/2137K,
paused 29ms
W/ActivityManager(  101): Launch timeout has expired, giving up wake lock!
I/AndroidDriverServlet(11123): Done: /session/1319144695320/element/3/click
I/AndroidDriverServlet(11123): Executing: [find element: By.name: storageInMB] at URL:
/session/1319144695320/element)
I/AndroidDriverServlet(11123): Done: /session/1319144695320/element
I/AndroidDriverServlet(11123): Executing: [clear: 4 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@bdad8f1f]
at URL: /session/1319144695320/element/4/clear)
D/dalvikvm(11123): GC_FOR_MALLOC freed 1420K, 45% free 5639K/10119K, external 2034K/2137K,
paused 26ms
I/AndroidDriverServlet(11123): Done: /session/1319144695320/element/4/clear
I/AndroidDriverServlet(11123): Executing: [send keys: 4 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@bdad8f1f,
[1024]] at URL: /session/1319144695320/element/4/value)
W/ActivityManager(  101): Activity idle timeout for HistoryRecord{408983c8 edu.umass.cs.benchlab/.BCRDriverActivity}
D/dalvikvm(11123): GC_FOR_MALLOC freed 1207K, 44% free 5706K/10119K, external 2034K/2137K,
paused 28ms
D/dalvikvm(11123): GC_FOR_MALLOC freed 1531K, 46% free 5549K/10119K, external 2034K/2137K,
paused 70ms
I/AndroidDriverServlet(11123): Done: /session/1319144695320/element/4/value
I/AndroidDriverServlet(11123): Executing: [find element: By.xpath: .//input[(@type='submit')
or (@type='reset') or (@type='image')][(@name='submit') or (@value='submit')] | .//button[@name='submit']
| .//button[@id='submit']] at URL: /session/1319144695320/element)
I/AndroidDriverServlet(11123): Done: /session/1319144695320/element
I/AndroidDriverServlet(11123): Executing: [submit: 5 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@bdad8f20]
at URL: /session/1319144695320/element/5/submit)
...
...
...

But still I don't see it on the browser.


Selenium version:
OS: Android 2.3
Browser:Android browser
Brower version:

Also, I have downloaded the new version of the webdriver code from the svn that is
supposed to have the xpath libraries etc. 


Please provide any additional information below. A sample reduced test
case, or a public URL that demonstrates the problem will intrigue our merry
band of Open Source developers far more than nothing at all: they'll be far
more likely to look at your problem if you make it easy for them!

Reported by veena3688 on 2011-10-20 21:24:49

@lukeis lukeis self-assigned this Mar 3, 2016
@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by berrada@google.com on 2011-10-20 21:59:19

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

I did manage to get past the "submit" button problem. Instead of doing we.submit(),
if I do we.sendKeys("\n"), it looks like it works. But I am still unable to resolve
the radio button check problem.

Reported by veena3688 on 2011-10-21 19:01:43

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by barancev on 2011-10-27 06:46:38

  • Labels added: Component-WebDriver, Browser-Android

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by berrada@google.com on 2012-01-27 17:00:07

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Selenium project no longer supports the AndroidDriver.

Please use Selendroid instead:
http://selendroid.io/webview.html

And log any issues against that project:
https://github.com/selendroid/selendroid/issues

Reported by luke.semerau on 2013-12-26 21:57:35

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 3, 2016

Reported by luke.semerau on 2015-09-17 18:13:58

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 3, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant