2017-10-09 41 views
-1

网页包含一个弹出窗口,弹出窗口中有<'object'>,通过显示另一个网站内容的对象弹出窗口。在这里,在该网站内容中,我无法使用硒将数据输入到登录字段。 为同一请在这里找到完整的HTML代码,请帮我提供此无法访问硒中的<object>标记中的元素

<div class="documentViewPopUp extrasPopUp" style> 
    <span style="kljhgjk ghjkljhg0"> 
    <div id="popContainer" class="popContainer" align ="center"> 
     <div class="row">.....</div> 
     <div class="row"> 
      ::before 
      <div class="col-md-20 col-xs-20"> 
       <div id="dc"> 
        <object data="http://80.80.80.80/ExternalService?RequestCode=ABCDEF34GH" id="ABCSLinkAppID" 
         class="col-md-30 col-md-offset-1 col-xs-30" height="800" type="text/html"> Alternative Content </object> 
         #document 
          <!DOCTYPE html> 
           <html class="robapp-html" lang="en" data-media-queries="enabled"> 
           <head>...........</head> 
           <body class="abc widget"> 
           <script type="text/javascript">......</script> 
           <div id="load" class="load">...</div> 
           <script type="text/javascript">.....</script> 
           <script type="text/javascript" src=""></script> 
           <div id="reelFeedBack" class="hide toast-message feedback-wrapper">.....</div> 

           <div id="modelInfo" class="hide toast-message none feedback-wrapper">......</div> 
           <div id="main-container" class="desktop-device module_10003600 gc multi-account" style="height: 800px; top: 0px;"> 
            <div class="gcContainer FL addMinHeight"> 
             <!-- head starts here --> 
            <div class="ada-offscreen adaScreenLoadMsgFL" tabindex="0">.....</div> 
             <!-- Header --> 
            <div class="header row collapse headerTitle fixedHeader">.......</div> 
             <!-- Header ends here --> 
             <!-- Content body start here --> 
            <div class="rwWrapper row full-page mainBody contentScroll" style="max-height: 704px; min-height: 554px;"> 
             ::before 
             <div id="twinnerWrapper"></div> 
             <div id="messageWrapper" class="small-plus-wrapper"></div> 
             <!-- -Splash page holder--> 
             <div id="splashPage" class="mobileContainer"></div> 
             <!-- Dummy region to aviod error--> 
             <div id="leftContent" class="panel card" style="display:none;"></div> 
             <!-- New theme wrapper --> 
             <div class="row collapse small-plus-wrapper" id="main-wapper">   
              ::before 
              <!-- Left section holder --> 
              <div class="full-page full-view full-view-bottom small-12" id="left-section"> 
               <div id="rightContent" class="panel card"> 
                <div id="main-container_panel_0" class="panel sub-panel active"> 
                 <div class="cardContainer"> 
                  <div id="main-container_panel_0_bodyContent" class="bodyContent desktop-device module_10003592 gc"> 
                   <div class="site-form"> 
                    <div class="mfawrapper-full-view full-view-bottom "> 
                     <div class=" row small-12">....</div> 
                     <div class="row collapse"> 
                      ::before 
                      <div class="small-12 columns small-centered medium-8 smallplusbox">  
                       <div class="squareWrapperSmallplus active no-border-for-mobile-only"> 
                        <div class="section-title show-for-smallplus-only " role="heading" aria-level="2">LOG IN TO YOUR ACCOUNT</div> 
                         <div id="thinplusHeader" class=" siteLogoWrapper show-for-medium-down hide-for-medium-only ">.....</div> 
                         <div class="sdhelpText show-for-medium-down hide-for-medium-only hide-for-smallplus-only ">......</div> 
                         <div class="mobile-wrapper"> 
                          <div id="ddcontent"> 
                           <div> 
                            <div class> 
                             <div class="row collapse row medium-7 ">.....</div> 
                             <!-- end of global error message --> 
                             <!-- Form display --> 
                              <form autocomplete="off" class=" row medium-7 with-form-fields "> 
                               <div class="sdloginForm"> 
                                <div class="row collapse " id="row_LOGIN"> 
                                 ::before 
                                 <div class="small-12 column end">....</div> 
                                 <div class="small-12 column end"> 
                                  <input type="text" name="LOGIN" id="UserLOGIN" maxlength="40" class="formField input-error-field 
                                  star_field" autocomplete="off" autocapitalize="off" autocorrect="off" spellcheck="false" placeholder="Catalog " 
                                  aria-label="Catalog " value=""> 
                                 </div> 

的可能的解决方案,也请看下面是我的硒代码。使用上面的代码

wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("extrasPopUp"))); 
Sleeper.sleepTightInSeconds(15); 
driver.switchTo().frame("ABCSLinkAppID"); 
driver.findElement(By.id("UserLOGIN")).sendKeys("emma"); 

// to get # of fields in the Object Content 
List<WebElement>fields=driver.findElements(By.tagName("input")); 
System.out.println(fields.size()); 

,我无法切换到对象的内容和 收到错误为“通过发现无边框元素名称或ID ABCSLinkAppID”

+0

请粘贴特定的HTML和问题 – iamsankalp89

+1

@ iamsankalp89,不要试图回答每一件事。不知道我问了什么,你怎么能低估我的问题。如果你没有足够的时间回答问题,请不要回答或不做任何事情。 –

+0

我不是downvoted,其次你的问题没有清除 – iamsankalp89

回答

0

为什么不使用你的元素声明的XPath?

//objectx0020data[@id='ABCSLinkAppID'] 

x0020是XML中的空间代码。使用此代替只有ID。