"Element is not currently visible and so may not be interacted with" Watir - watir

Facing the issue when the code is executed in test script. the same code executes fine in irb
#browser.div(:class=>/DownArrowButton/).when_present.click #works fine, dropdown
popup = #browser.div(:id=>'pgObjectSelector_Popover')
popup.text_fields(:id=>/dijit_form_TextBox_/).select{|s| s.visible?}[0].when_present.set('ethernet')
While setting the key the widget gets closed with an error:
Element is not currently visible and so may not be interacted with
[remote server] file:///C:/Users/suchanna/AppData/Local/Temp/webdriver-profile20150319-30448-a96p5v/extensions/fxdriver#googl
ecode.com/components/command-processor.js:8991:in `fxdriver.preconditions.visible'
Please help me out for the above problem
Html:
<div id="pgObjectSelector_Popover" class="xwtPopover dijitTooltipDialog xwt_BasePickerPopover dijitTooltipABLeft dijitTooltipBelow" wairole="presentation" widgetid="pgObjectSelector_Popover" style="top: 0px; display: none;">
<div class="dijitTooltipContainer" data-dojo-attach-event="onkeypress: _onKey" wairole="dialog" waistate="labelledby-pgObjectSelector_Popover_title" data-dojo-attach-point="_outsideContainer" style="">
<table class="xwtPopoverMenuBar" cellspacing="0" cellpadding="0" data-dojo-attach-point="menuBar" wairole="presentation"></table>
<div class="xwtPopoverPadding" data-dojo-attach-point="_paddingContainer">
<div class="dijitTooltipContents dijitTooltipFocusNode" tabindex="-1" data-dojo-attach-point="_scrollBox" style="overflow-x: hidden;">
<table class="xwtPopoverTable" wairole="presentation">
<tbody>
<tr>
<td wairole="presentation">
<div class="xwtPopoverContainer" wairole="presentation" tabindex="-1" data-dojo-attach-point="containerNode">
<div id="dijit_layout_BorderContainer_0" class="dijitBorderContainerNoGutter dijitContainer dijitLayoutContainer" widgetid="dijit_layout_BorderContainer_0" style="padding: 0px; width: 275px; height: 300px;">
<div id="dijit_layout_ContentPane_1" class="dijitContentPane dijitBorderContainerNoGutter-child dijitBor…nerNoGutterPane dijitAlignCenter dijitContentPaneSingleChild" widgetid="dijit_layout_ContentPane_1" style="left: 0px; top: 0px; position: absolute; width: 275px; height: 300px;">
<div id="pgObjectSelector_osInstance" class="xwtobjectselector" minheight="100" minwidth="220" data-dojo-attach-point="osNode" widgetid="pgObjectSelector_osInstance" style="cursor: default; width: 273px; height: 298px;">
<div id="xwt_widget_objectselector__Titlebar_0" class="xwtOsTitlebar" minwidth="100" data-dojo-attach-point="titleBar" widgetid="xwt_widget_objectselector__Titlebar_0"></div>
<div class="xwtobjectselectorcontents xwtOSDataReady" data-dojo-attach-point="osContents">
<div class="xwtObjectSelectorToolbars" data-dojo-attach-point="toolbars">
<div id="xwt_widget_objectselector__ObjectSelectorToolbar_0" class="xwtOsToolbar" data-dojo-attach-point="ButtonToolbar" minwidth="100" data-dojo-type="xwt.widget.toolbar.LayoutToolbar" widgetid="xwt_widget_objectselector__ObjectSelectorToolbar_0" style="display: none;"></div>
<div id="xwt_widget_filtertoolbar_FilterToolbar_0" class="xwtFilterToolbar" widgetid="xwt_widget_filtertoolbar_FilterToolbar_0" style="width: 273px;">
<div class="xwtFilterbarLeft" data-dojo-attach-point="SearchLeftGroup"></div>
<div class="xwtFilterbarCenter" data-dojo-attach-point="SearchCenterGroup">
<div class="xwtFilterSearchIcon icon-cisco-search" title="Search" tabindex="0" data-dojo-attach-point="searchButton">
<div class="xwt-ButtonSearchTextHighContrast" data-dojo-attach-point="searchTextHighCont"></div>
<span class="xwtFilterSearchText" data-dojo-attach-point="searchText"></span>
</div>
<span class="dijit dijitReset dijitInline xwtFilterDownButton xwtFilterDownIcon xwtFilterbarDropdownOff" widgetid="dijit_form_DropDownButton_3">
<span class="dijitReset dijitInline dijitButtonNode" data-dojo-attach-point="_buttonNode" data-dojo-attach-event="ondijitclick:__onClick"></span>
<input class="dijitOffScreen" type="button" aria-hidden="true" role="presentation" data-dojo-attach-point="valueNode" data-dojo-attach-event="onclick:_onClick" tabindex="-1" value=""></input>
</span>
<div id="widget_dijit_form_TextBox_1" class="dijit dijitReset dijitInline dijitLeft xwtFilterSearchBox dijitTextBox" role="presentation" widgetid="dijit_form_TextBox_1" style="width: 185px;">
<div class="dijitReset dijitInputField dijitInputContainer">
<input id="dijit_form_TextBox_1" class="dijitReset dijitInputInner" type="text" autocomplete="off" data-dojo-attach-point="textbox,focusNode" tabindex="0" value=""></input>
<span class="dijitPlaceHolder dijitInputField">
Search All
</span>
</div>
</div>
<div class="xwtFilterClearIcon" data-dojo-attach-event="ondijitclick: _clearIconClicked" tabindex="0" data-dojo-attach-point="closeButton"></div>
<div class="xwtClear"></div>
</div>
<div class="xwtFilterbarRight" data-dojo-attach-point="SearchRightGroup"></div>
<div class="xwtAdvFilterButton" data-dojo-attach-point="advancedFilter"></div>
<div class="xwtClear"></div>
</div>
<div id="dijit_layout_ContentPane_0" class="dijitContentPane xwtOsScopeTabs" dolayout="true" minwidth="100" data-dojo-type="dijit/layout/ContentPane" data-dojo-attach-point="scopeTabs" widgetid="dijit_layout_ContentPane_0"></div>
<div id="xwt_widget_objectselector__SelectionDisplayBar_0" class="xwtOsSelectionBar" minwidth="100" data-dojo-attach-point="selectionBar" widgetid="xwt_widget_objectselector__SelectionDisplayBar_0" style="width: 268px;"></div>
</div>
<div id="dijit_layout_StackContainer_0" class="xwtobjectselectorview dijitStackContainer dijitContainer dijitLayoutContainer xwtOSDataReady xwtOsStackContainer" dolayout="true" data-dojo-attach-point="containerNode" widgetid="dijit_layout_StackContainer_0" style="width: 273px; height: 214px;"></div>
</div>
<div class="resizeHandleBoth" data-dojo-attach-point="resizeHandleAP" style="display: none;"></div>
<div class="xwtOsFooter"></div>
<div class="xwtOsLeftShadow"></div>
<div class="xwtOsRightShadow"></div>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="xwtPopoverFooter" data-dojo-attach-point="footer"></div>
</div>
<!--
Added connector attach point
-->
<div class="dijitTooltipConnector" data-dojo-attach-point="connector" wairole="presentation" style="left: 8px;"></div>
<div class="xwtPopoverLoader icon-spinner icon-spin" data-dojo-attach-point="loader" style="bottom: 139.333px; left: 153.5px; display: none;"></div>
</div>
</div>

Ok, first at all, if you need to set any text to this field, you can make div with:
id => 'pgObjectSelector_Popover' with JavaScript, using execute_script: #browser.execute_script("document.getElementById('pgObjectSelector_Popover').style.display = 'block';"), after, this pop-up have just one text_field so, you can do: #browser.div(pgObjectSelector_Popover).text_field.set 'ethernet'
Second,
#browser.div(:class=>/DownArrowButton/).when_present.click
#browser.div(:id=>'pgObjectSelector_Popover').text_field.set 'ethernet'

Related

How to click on the element using the innerText text of a class in Selenium vba

I am willing to get the innerText and click on it. The text is Customer Service Inquiry.
I have tried:
.FindElementsByXPath("//*[text()[contains(.listItem, 'Customer Service Inquiry')]]").Click
This does not work as it gives error that it is not a valid xpath expression
Further, this works but I am wanting to click by what the inner text says.
.FindElementByXPath("//*[#id='listFav_ALLOUTSECURITY0000000000000000008276_APP_P4210_W4210E_PSG0021_20']").click
The html
<div id="listContentHolder"> == $0 > <div class="carolist" id="listOCL" slot="0" style="height: 57px; top: #px;">.</div> > <div class="carolist" id="listRecipts" slot="1" style="height: 57px; top: 57px;">.</div> <div class="caroList" id="listFav" slot="2" style="height: 153px; top: 114px;"> > <div class="listHeader expanded" id="listFavHeader" oncontextmenu="javascript:CARO.updateDropdownMenuView(this,event);jdebebGUIdoToggleSubMenu(this,'caroTabContextMenu', event, true)
;" toplistitem="false">.</div> <div id="listFavouter" class="listContentOuter" style="height: 128px;"> <div id="listFavInner" class="listContentInner" style="height: 128px; top: Opx;">
<div class="listItem" id="listFav_manageFavs" aria-labelledby="appCaption_fav_manageFavs" role="link" tabindex="0" style="user-select: none; top: Opx;">.</div> > <div class="listItem" id="listFav_ALLOUTSECURITY0000000000000000008582_APP_P4210_W4210E_PSG0099_10" aria-labelledby="appCaption_fav_ALLOUTSECURITY0000000000000000008582_APP_P4210_W 4210E_PSG0099_10" role="link" tabindex="0" style="user-select: none; top: 32px;">.</div>
<div class="listItem" id="listFav_ALLOUTSECURITY0000000000000000008276_APP_P4210_W4210E_PSG0021_20" aria-labelledby="appCaption_fav_ALLOUTSECURITY0000000000000000008276_APP_P4210_W 4210E_PSG0021_20" role="link" tabindex="0" style="user-select: none; top: 64px;"> <table class="listItem">
<tbody>
<tr> >
<td class="listIcon">.</td>
<td class="listText">Customer Service Inquiry</td>
</tr>
</tbody>
</table>
</div>
<div class="listItem" id="listFav_21343ad6_1803cf57c8c__7ffeE1PDJAS3__APP_P41026_W41026E_PSA0001_30" aria-labelledby="appCaption_fav_21343ad6_1803cf57c8c__7ffeE1PDJAS3_APP_P41026_ W41026E_PSA0001_30" role="link" tabindex="0" style="user-select: none; top: 96px;">.</div> </div> <a class="panControl up" necessary="false" style></a>
<a class="panControl down" necessary="false" stylex/a> </div> </div> </div>
To click on the element with text as Customer Service Inquiry you can use either of the following locator strategies:
Using FindElementByXPath and only the innerText:
.FindElementByXPath("//td[text()='Customer Service Inquiry']").click
Using FindElementByXPath along with the class and the innerText:
.FindElementByXPath("//td[#class='listText' and text()='Customer Service Inquiry']").click

bootstrap 5 carousel is not responsive and text missing

I am new to web devolopment, i want to add carousel in my project so i have copied this basic template from bootstrap docs, in desktop view it working but in mobile view it showing a unwanted black space and captions missing, please some one help
I am new to web devolopment, i want to add carousel in my project so i have copied this basic template from bootstrap docs, in desktop view it working but in mobile view it showing a unwanted black space and captions missing, please some one help
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<section class="home">
<div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="{% static 'img/slide-1.jpg' %}" class="d-block w-100 h-auto" alt="...">
<div class="carousel-caption d-none d-md-block">
<h5>First slide label</h5>
<p>Some representative placeholder content for the first slide.</p>
</div>
</div>
<div class="carousel-item">
<img src="{% static 'img/slide-2.jpg' %}" class="d-block w-100 h-auto" alt="...">
<div class="carousel-caption d-none d-md-block">
<h5>Second slide label</h5>
<p>Some representative placeholder content for the second slide.</p>
</div>
</div>
<div class="carousel-item">
<img src="{% static 'img/slide-3.jpg' %}" class="d-block w-100 h-auto" alt="...">
<div class="carousel-caption d-none d-md-block">
<h5>Third slide label</h5>
<p>Some representative placeholder content for the third slide.</p>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</section>
</body>
</html>
custom.css
.carousel-item {
height: 24rem;
background: #000;
}
.carousel-item>img {
position: absolute;
top: 0;
left: 0;
max-width: 100%;
height: 100%;
opacity: 0.5;
}
.carousel-inner > .item > img {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
height: 500px;
}
.carousel-caption{
bottom: 25%;
}
.carousel-caption h5{
font-size: 30px;
margin-bottom: 20px;
}
.carousel-caption p{
font-size: 20px;
}
To make testing easier i added some grey color to the background (you can remove it later).
What I think you are missing, is to add the Bootstrap scripts, you can see the code for an example.
Here you have how to do it, from Bootstrap documentation.
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
>>>>>>>>>> SCRIPTS HERE <<<<<<<<<<<<<
<script src="https://cdn.jsdelivr.net/npm/#popperjs/core#2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/js/bootstrap.min.js" integrity="sha384-Atwg2Pkwv9vp0ygtn1JAojH0nYbwNJLPhwyoVbhoPwBhjQPR5VtM2+xf0Uwh9KtT" crossorigin="anonymous"></script>
>>>>>>>>>>> UP HERE <<<<<<<<<<<<<<<<<
<title></title>
</head>
<body style="background-color: gray">
<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="..." class="d-block w-100" alt="IMAGE 1">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="IMAGE 2">
</div>
<div class="carousel-item">
<img src="..." class="d-block w-100" alt="IMAGE 3">
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
</body>
</html>
Regarding your question about "where" to put the text, after the images will be ok.
Here you have a working example (from one of my portfolio projects):
<!-- Testimonials -->
<section id="testimonials" class="colored-section">
<div id="testimonials-carousel" class="carousel slide" data-ride="false">
<div class="carousel-inner">
<div class="carousel-item active container-fluid">
<h2 class="testimonial-text">I no longer have to sniff other dogs for love. I've found the hottest Corgi on TinDog. Woof.</h2>
<img class="testimonial-image" src="images/dog-img.jpg" alt="dog-profile">
<em>Pebbles, New York</em>
</div>
<div class="carousel-item container-fluid">
<h2 class="testimonial-text">My dog used to be so lonely, but with TinDog's help, they've found the love of their life. I think.</h2>
<img class="testimonial-image" src="images/lady-img.jpg" alt="lady-profile">
<em>Beverly, Illinois</em>
</div>
</div>
<a class="carousel-control-prev" href="#testimonials-carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#testimonials-carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</section>
</html>
Please, mark the answer as accepted ;)
below things worked for me
<div class="carousel-caption d-block">
Instead of
<div class="carousel-caption d-none d-md-block">
read here display properties

Equal height children images in responsive Bootstrap 4 columns. How to?

Using Bootstrap 4, I'd like to create 3 columns that adjust their width so that padding of each column is consistent and the height of each image is consistent between each column. The goal is for the width and height of each image to increase/decrease as page width changes. Notice, the height of the images and columns should always be synced. I know I can use percentages, but I was hoping there was a flexbox solution. Thanks
Codepen: https://codepen.io/danielgetsthis/pen/qJgyNx
<div class="container">
<div class="row">
<div class="col">
<a href="#" class="text-center">
<span>1</span>
<img src="http://placehold.jp/100x100.png" />
</a>
</div>
<div class="col">
<a href="#" class="text-center">
<span>2</span>
<img src="http://placehold.jp/200x100.png" />
</a>
</div>
<div class="col">
<a href="#" class="text-center">
<span>3</span>
<img src="http://placehold.jp/300x100.png" />
</a>
</div>
</div>
</div>
I'm not sure that I understand the height issue. The columns and images are the same height. To equalize the padding around the images use col-auto instead of col. This makes the columns shrink to fit the width of their content.
<div class="container">
<div class="row justify-content-center">
<div class="col-auto">
<a href="#" class="text-center">
<span>1</span>
<img src="http://placehold.jp/100x100.png" />
</a>
</div>
<div class="col-auto">
<a href="#" class="text-center">
<span>2</span>
<img src="http://placehold.jp/200x100.png" />
</a>
</div>
<div class="col-auto">
<a href="#" class="text-center">
<span>3</span>
<img src="http://placehold.jp/300x100.png" />
</a>
</div>
</div>
</div>
https://www.codeply.com/go/XtNGjb765u
body{
background-color: #eee;
box-sizing: border-box;
}
.col {
display: flex;
flex: 0;
flex-direction: initial;
}
.col a {
display: flex;
flex-wrap: wrap;
padding: 10%;
background-color: tomato;
border: 1px solid green;
color: #FFF;
font-size: 26px;
justify-content: center;
}
span{
display: block;
text-align:center;
}

python selenium login slide bar

When I access the website and log-in manually, it works well.
However, when I use selenium webdriver and try to log in, this login slide bar shows, so I can't log in.
This is my code as followed.
id = driver.find_element_by_css_selector('#TPL_username_1').send_keys("prayjung50")
pw = driver.find_element_by_xpath('//*[#id="TPL_password_1"]').send_keys("xxxxxxxxxxxx")
time.sleep(10)
login = driver.find_element_by_xpath('//*[#id="J_SubmitStatic"]').click()
This is the image of the website as followed.
This is the website code of slide bar as followed.
<!-- use new slide checkcode -->
<div id="nocaptcha" class="nc-container tb-login nc-tm-min-fix" data-nc-idx="1" style="display: block;">
<div id="nc_1_wrapper" class="nc_wrapper">
<div id="nc_1_n1t" class="nc_scale">
<div id="nc_1__bg" class="nc_bg"></div>
<span id="nc_1_n1z" class="nc_iconfont btn_slide"></span>
<div id="nc_1__scale_text" class="scale_text slidetounlock"><span class="nc-lang-cnt" data-nc-lang="_startTEXT" data-spm-anchor-id="a2107.1.0.i0.3e3e11d9wfV1qj">请按住滑块,拖动到最右边</span></div>
<div id="nc_1_clickCaptcha" class="clickCaptcha" style="top: -202px; height: 380px; min-height: 0px;">
<div class="clickCaptcha_text">
<b id="nc_1__captcha_text" class="nc_captch_text"></b>
<i id="nc_1__btn_2" class="nc_iconfont nc_btn_2 btn_refresh"></i>
</div>
<div class="clickCaptcha_img"></div>
<div class="clickCaptcha_btn"></div>
</div>
<div id="nc_1_imgCaptcha" class="imgCaptcha" style="top: -202px; height: 339px; min-height: 0px;">
<div class="imgCaptcha_text"><input id="nc_1_captcha_input" maxlength="6" type="text" style="ime-mode:disabled"></div>
<div class="imgCaptcha_img" id="nc_1__imgCaptcha_img"></div>
<i id="nc_1__btn_1" class="nc_iconfont nc_btn_1 btn_refresh" onclick="document.getElementById('nc_1__imgCaptcha_img').children[0].click()"></i>
<div class="imgCaptcha_btn">
<div id="nc_1__captcha_img_text" class="nc_captcha_img_text"></div>
<div id="nc_1_scale_submit" class="nc_scale_submit"></div>
</div>
</div>
<div id="nc_1_cc" class="nc-cc"></div>
<i id="nc_1__voicebtn" tabindex="0" role="button" class="nc_voicebtn nc_iconfont" style="display:none"></i>
<b id="nc_1__helpbtn" class="nc_helpbtn"><span class="nc-lang-cnt" data-nc-lang="_learning">了解新功能</span></b>
</div>
<div id="nc_1__voice" class="nc_voice"></div>
</div>
</div>"a2107.1.0.i0.3e3e11d9wfV1qj">请按住滑块,拖动到最右边</span>

DevExtreme dropdowns and Watir

So in upgrading from DevExpress to DevExtreme, DE seems to have gone out of their way to block any automation engine but their own.
Select boxes are build as a layer of custom DIV tags with a read-only input tag in the middle.
When selected, the dropdown list is generated as a DIV list structure tied to the /body/ level of the page source.
This list unloads when the dropdown list closes.
Waitr can see and interact with the list the first time it appears on the page, but once it unloads I cannot get it to find it again.
I have tried Page Object references, native Watir dynamic references, nothing works.
Interestingly I do not get the common 'no longer attached to the DOM' error, just an empty string.
All of the workarounds from DevExpress have been deactivated or blocked.
Has anyone found a way to automate these controls besides exposed JS calls?
Select Box:
<div class="dx-texteditor dx-dropdowneditor-button-visible dx-widget dx-textbox dx-dropdowneditor-field-clickable dx-dropdowneditor dx-selectbox dx-validator dx-visibility-change-handler" id="Active_Y_or_N" typeof="drpdown" validations="[{"type":"required"}]" value="1" items="[{"Value":1.0,"Text":"Yes","DropDownType":"Active Y or N"},{"Value":2.0,"Text":"No","DropDownType":"Active Y or N"}]" originalvalue="1">
<div onclick="void(0)" class="dx-dropdowneditor-input-wrapper dx-selectbox-container">
<div class="dx-texteditor-container">
<input id="Active_Y_or_N_1" aria-expanded="false" role="combobox" tabindex="0" spellcheck="false" readonly="" aria-autocomplete="list" aria-haspopup="true" autocomplete="off" class="dx-texteditor-input" type="text">
<div class="dx-placeholder dx-state-invisible" data-dx_placeholder="Select..."></div>
<div class="dx-texteditor-buttons-container">
<div role="button" onclick="void(0)" class="dx-widget dx-button-normal dx-dropdowneditor-button">
<div class="dx-dropdowneditor-icon"></div>
</div>
</div>
</div>
</div>
List:
<div style="width: 212px; height: 61px; z-index: 1001; margin: 0px; left: 0px; top: 0px; transform: translate(264px, 365px); transition: none 0s ease 0s ; visibility: visible; opacity: 1;" class="dx-overlay-content dx-popup-normal dx-popup-draggable dx-resizable">
<div style="height: 60px;" id="2ceea1a1-35ca-5e1d-72c1-17ca0c70daa9" class="dx-popup-content">
<div aria-activedescendant="3cc4c726-d65a-4248-b16c-6cd8ed666d08" tabindex="-1" role="listbox" class="dx-scrollable dx-scrollview dx-scrollable-customizable-scrollbars dx-scrollable-vertical dx-scrollable-simulated dx-visibility-change-handler dx-list dx-widget dx-collection" id="2779756d-884a-7d65-dd53-5ab194255698">
<div class="dx-scrollable-container">
<div style="transform: translate(0px, 0px);" class="dx-scrollable-content">
<div class="dx-scrollview-top-pocket">
<div style="display: none;" class="dx-scrollview-pull-down">
<div class="dx-scrollview-pull-down-image"></div>
<div class="dx-scrollview-pull-down-indicator">
<div class="dx-loadindicator dx-widget">
<div class="dx-loadindicator-wrapper">
<div class="dx-loadindicator-content">
<div class="dx-loadindicator-icon">
<div class="dx-loadindicator-segment dx-loadindicator-segment7"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment6"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment5"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment4"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment3"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment2"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment1"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment0"></div>
</div>
</div>
<div class="dx-loadindicator-content"></div>
</div>
</div>
</div>
<div class="dx-scrollview-pull-down-text">
<div style="opacity: 1;">Pull down to refresh...</div>
<div style="opacity: 0;">Release to refresh...</div>
<div style="opacity: 0;">Refreshing...</div>
</div>
</div>
</div>
<div onclick="void(0)" class="dx-scrollview-content">
<div id="3cc4c726-d65a-4248-b16c-6cd8ed666d08" aria-selected="false" role="option" class="dx-item dx-list-item dx-state-focused">
<div class="dx-item-content dx-list-item-content">Yes</div>
</div>
<div aria-selected="false" role="option" class="dx-item dx-list-item">
<div class="dx-item-content dx-list-item-content">No</div>
</div>
</div>
<div class="dx-scrollview-bottom-pocket">
<div style="display: none;" class="dx-scrollview-scrollbottom">
<div class="dx-scrollview-scrollbottom-indicator">
<div class="dx-loadindicator dx-widget">
<div class="dx-loadindicator-wrapper">
<div class="dx-loadindicator-content">
<div class="dx-loadindicator-icon">
<div class="dx-loadindicator-segment dx-loadindicator-segment7"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment6"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment5"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment4"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment3"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment2"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment1"></div>
<div class="dx-loadindicator-segment dx-loadindicator-segment0"></div>
</div>
</div>
<div class="dx-loadindicator-content">
</div>
</div>
</div>
</div>
<div class="dx-scrollview-scrollbottom-text">Loading...</div>
</div>
</div>
</div>
<div style="display: none;" class="dx-scrollable-scrollbar dx-widget dx-scrollbar-vertical dx-scrollbar-hoverable">
<div style="transform: translate(0px, 0px); height: 58px;" class="dx-scrollable-scroll dx-state-invisible">
<div class="dx-scrollable-scroll-content"></div>
</div>
</div>
</div>
<div class="dx-scrollview-loadpanel dx-overlay dx-widget dx-visibility-change-handler dx-state-invisible dx-loadpanel">
<div aria-hidden="true" style="width: 222px; height: 90px;" class="dx-overlay-content"></div>
</div>
code (one version anyway):
self.send("#{field}_element").div(:class => 'dx-dropdowneditor-icon').click
drpdwn = #browser.div(:class => 'dx-scrollview-content')
if drpdwn.text.include? value
drpdwn.div(:text => value).click
else
fail "value (#{value}) not found in list (#{self.drop_list_element.text})"
end
It is very hard to answer because I can't see your code and I have no example. So maybe it's a wrong answer. But if your statement:
On the second load of the list, Watir can see it as existing, but not visible.
is correct. Then you can force watir to work with not visible elements using:
browser.hidden(id: "your_element").click
Try it please.

Resources