issue in object identification

41 views
Skip to first unread message

vivek...@gmail.com

unread,
Nov 25, 2013, 10:08:13 PM11/25/13
to seleniu...@googlegroups.com
Hi All,

Assume the follow code

in the frame, i want to select a unique service number(Marked in Red
what is the best way to do that

<div id="cboxContent" style="float: left; width: 470px; height: 550px;">
<div id="cboxLoadedContent" style="display: block; width: 370px; overflow: auto; height: 470px;">
<iframe class="cboxIframe" frameborder="0" name="cbox1385434207856" src="/myaccount/Templates/Pages/ServicePicker.aspx?sessionName=d2b02ba6-5b0e-495b-9ee2-b3ecb5f1a0cc&id=1006">
<!DOCTYPE html>
<html class=" js no-flexbox canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths" lang="en">
<head id="ctl00_head">
<body id="master" class="gradient modalbox switcher">
<form id="aspnetForm" action="/myaccount/Service-Picker/?sessionName=d2b02ba6-5b0e-495b-9ee2-b3ecb5f1a0cc" method="post" name="aspnetForm">
<div>
<script type="text/javascript">
<script type="text/javascript" src="/MyAccount/WebResource.axd?d=ynu7WnXaqWCdzVADS5Y1vtHbsILjO-zMOtvqOuhHfd5Gf1klrUgfX_QJZ3Ky2ArI09cyAqMTcLVOKRoCb03VINmaFCO8vJYj1nwlCHvG0sQ1&t=634944064010655426">
<script type="text/javascript" src="/MyAccount/ScriptResource.axd?d=ldimqPDqZj1XbuxI-7LVhEQ5LwqIo4vYvvGjvLt2KtsAg7GAwQQqbhzBukat_Z2J-fC9456bUOvG7FyTqYGYRYzUEQyK2c5Q01varyY526EsSQdcDSmFJELJ0F7k54C7siAtuy2KmgaeVcFAjTj-G-IR87zQeFDKhk-Gq8ch-Pk1&t=ffffffff940d030f">
<script type="text/javascript" src="/MyAccount/ScriptResource.axd?d=HSxXrxE4eYzHtZ_3CvlLzD5oNnJ7WDtawy55Q4vd9czs7GD4Sc0uIj9mdOdPpLyrlCIgDQi3usn0_PnGjfGqoxVbvN_pZjxhsjWxfIW2eRnXvNksm9iNNiBaVhXRBZN5by81VzVZSpKxyx9itmya1RC_oyNPsSGYutyhPkWM0YR4a5MbLmxadAAWr_ztLn4P0&t=ffffffff940d030f">
<div>
<script type="text/javascript">
<input id="ctl00_ScriptManagerControl_ScriptManager" type="hidden" name="ctl00$ScriptManagerControl$ScriptManager">
<script type="text/javascript">
<div id="ctl00_ScriptManagerControl_updProgress" style="display:none;" role="status" aria-hidden="true"> </div>
<script language="javascript" type="text/javascript">
<div class="container">
<div class="container padding-left-10 padding-right-10">
<h1>Select service</h1>
<div class="service-picker-body">
<p></p>
<p>Please select the service you would like to log in to:</p>
<ul id="service-switcher">
<li>
<li>
<li>
<a id="ctl00_FullContentArea_rptServiceOptions_ctl01_hypServiceOption" class="switcher postpaid-mobile good" href="javascript:__doPostBack('ctl00$FullContentArea$rptServiceOptions$ctl01$hypServiceOption','')" data-servicenumber="0435528189">
<img id="ctl00_FullContentArea_rptServiceOptions_ctl01_imgServiceIcon" class="service-icon-img pull-left" src="/MyAccount/Global/Summary/icn-service-mobile.png">
<span class="pull-left margin-left-10">
<h3 class="semibold remove-color remove-margin">0435528189</h3>
<h3 class="semibold remove-color remove-margin">Postpaid Mobile</h3>
</span>
</a>
</li>
</ul>
</div>
<div class="service-picker-footer">
</div>
<script type="text/javascript">
</form>
<script type="text/javascript">

Shawn McCarthy

unread,
Nov 26, 2013, 10:39:10 AM11/26/13
to seleniu...@googlegroups.com

driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[class='cboxIframe']")));

WebElement yourElement = driver.findElement(By.id("ctl00_FullContentArea_rptServiceOptions_ctl01_hypServiceOption"));


Does that help?


Shawn

Reply all
Reply to author
Forward
0 new messages