Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object locators fail on table data elements. #219

Closed
deanml opened this issue Sep 9, 2014 · 4 comments
Closed

Object locators fail on table data elements. #219

deanml opened this issue Sep 9, 2014 · 4 comments
Labels
Milestone

Comments

@deanml
Copy link

deanml commented Sep 9, 2014

Trying to find elements failing when elements embedded in html tables:
Tried
id: user_name
name: user_name
CSS: #user_name
xpath: //form/table/tbody/tr[3]/td[2]/input
link: User name:
All fail, I also tried explicit xpath and css as copied from firebug but for some reason, the attached html code is giving builder problems locating the user_name, password and login elements. I did not want to include the entire html code but the code for the user_name element should be present. I'm not sure that has anything to do with the failures but if you see anything else that might be interfering with the location methods, it would be good to investigate.

<html class="ltr" dir="ltr" webdriver="true">
<head>
<body>
<script src="/scripts/navpage.jsx?v=04-04-2014_1236" type="text/javascript">
<script>
<script src="/scripts/classes/RequestManager.jsx?v=04-04-2014_1236" type="text/javascript">
<table class="navpage" cellspacing="0" cellpadding="0" border="0">
<input id="banner_language" type="hidden" value="en">
<tbody>
<tr id="banner_row" style="margin: 0px; height: 1px; ">
<tr style="height: 16px;">
<tr>
<td colspan="99">
<table class="navbody" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td id="navControlsTD" class="navControlsTD" nowrap="true">
<td id="linenavtd" class="navpage_middle" rowspan="2">
<td id="rightnavtd" class="navpage_right" width="82%" rowspan="2">
<iframe id="gsft_main" class="gsft_full" frameborder="0" longdesc="Content frame for content and lists loaded from the navigator" src="welcome.do" name="gsft_main" onload="timeoutOutputMessages('output_message');" style="position: relative; left: 0px; top: 0px;" title="Navigation Content">
<html class=" ltr" lang="en" dir="ltr" webdriver="true">
<head>
<body onfocus="popupClose();" ontouchend="CustomEvent.fireAll('body_clicked', event);" onclick="CustomEvent.fireAll('body_clicked', event);">
<div class="body-vertical-spacer"></div>
<div class="outputmsg_div">
<form id="loginPage" name="loginPage" method="post" action="login.do">
<table>
<tbody>
<tr>
<tr>
<tr>
<td>
<td>
<input id="user_name" type="text" name="user_name" autocomplete="off" value="">
<script>
</td>
</tr>
<tr>
<tr id="remembermeoption" style="display: notnone">
<tr>
<tr></tr>
<tr>
</tbody>
</table>
</form>
<script language="javascript">
<br>
<br>
<hr>
<div class="text_caption">Welcome to the Operations Management System</div>
<div>
<hr>
<div class="text_caption">How To Login</div>
<div>To login to the OMS, please use your MyFamily.int credentials--the same credentials you use to logon to your computer.  Do NOT include myfamily in the "User name:" field.  For example, the user name would be "employee" NOT "myfamily\employee".</div>
<div style="border:none; visibility:hidden">
<script>
<script type="text/javascript">
<script src="/scripts/js_includes_last.jsx?v=04-04-2014_1236&lp=Wed_Aug_20_13_53_58_PDT_2014&c=6_42" type="text/javascript">
<script type="text/javascript">
<script type="text/javascript">
<script id="glide:page_timing_div" type="application/xml">
<script id="glide:page_timing_details" type="application/xml">
<script id="glide:page_timing_detail_line" type="application/xml">
<script id="glide:page_timing_child_line" type="application/xml">
<script type="text/javascript">
<div style="padding-left: 1px; width: 1px;"></div>
<div id="page_timing_div" class="timingDiv" style="visibility: visible;">
</body>
</html>
</iframe>
</td>
</tr>
<tr>
</tbody>
</table>
</td>
</tr>
<script>
<script>
<tr id="footerTrayRow" class="footer-tray-hidden">
</tbody>
</table>
<div id="ghostSplitter" class="ghost-splitter"></div>
<script type="text/javascript">
<script src="/scripts/js_includes_last.jsx?v=04-04-2014_1236&lp=Wed_Aug_20_13_53_58_PDT_2014&c=6_42" type="text/javascript">
<script type="text/javascript">
<script>
<script type="text/javascript">
<div style="padding-left: 1px; width: 1px;"></div>
</body>
@Zarkonnen
Copy link

Will have a look. Thanks for including the HTML it goes wrong on. 👍

@Zarkonnen Zarkonnen added the bug label Sep 23, 2014
@Zarkonnen Zarkonnen added this to the Builder 2.2.4 milestone Sep 23, 2014
@deanml
Copy link
Author

deanml commented Oct 3, 2014

I figured this out. To get this to work with webdriver API I had to use the driver.switchTo().frame(); method. I noticed that builder also has this action under Misc. I think this was a simple problem that I was in a different frame. Question becomes if builder should automatically add the switchToFrame action when clicking on elements in different frames.

@Zarkonnen
Copy link

Thanks for the update!

@Zarkonnen
Copy link

Closing this as a bug and adding switchToFrame thing as an enhancement request: #221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants