Despite their significant contributions to deep learning, LSTMs have limitations, notably in revising stored information. For instance, when faced with…
Development
Integrating visual and textual data in artificial intelligence forms a crucial nexus for developing systems like human perception. As AI…
The discipline of computational mathematics continuously seeks methods to bolster the reasoning capabilities of large language models (LLMs). These models…
Everything is online in the 21st century; almost everyone has a website or interacts with one daily. It is a…
I’ve tried for days to figure this one out. I have a selector that I can’t figure out. It seems to be a regular select statement with multiple options but when clicking one option directly it changes the title on a button. I can’t figure out how to manipulate it. All I want to do is find a specific selection option and select it. I don’t need to select multiple options.
The code I’m seeing is as follows:
<select multiple=”” id=”assignTo” data-placeholder=”Select Instructor(s)” title=”Instructor(S)” name=”instructors” class=”form-control bootstrapmultiselect” style=”display: none;”>
<option value=”864979″>Joe Smith</option>
<option value=”355944″>Mary Jones</option>
<option value=”44177″>Bill Smith</option>
<option value=”551573″>Susan Carter</option>
<option value=”883308″>Brian Bird</option>
</select>
<div class=”btn-group” style=”width: 100%;”>
<button type=”button” class=”multiselect dropdown-toggle btn btn-default” data-toggle=”dropdown” title=”None selected” style=”width: 100%;”>None selected <strong class=”caret”></strong></button>
Here’s the code I’ve tried:
drop = select(driver.find_element_by_id(‘assignTo’))
instructor_option = WebDriverWait(driver,5).until(lambda x: x.find_element_by_xpath(“//select[@id=’assignTo’]/option[text()=’Bill Smith’]”))
instructor_option.select()
Any ideas? I appreciate any help at all!
I m trying to click on the dropdown menu item and i am able to select the dropdown and the menu item but instead of clicking on item the click is going to the element right under it.
Before the dropdown code, I am executing the following code to close the pop up window
driver.switchTo().window(windowHandle).close();
driver.switchTo().window(driver.getWindowHandles().toArray()[0].toString());
I think this might have something to do with click going to wrong item
JAVA CODE
driver.findElement(By.xpath(“//*[@id=’ext-gen32′]/table/tbody/tr[2]/td[2]/em[@class=’x-btn-split’]”)).click();
org.openqa.selenium.interactions.Actions action = new org.openqa.selenium.interactions.Actions(driver);
boolean ele = isElementPresent(By.xpath(Configurations.getServiceLocator(“sc.cases.arrow”)));
String arrow = “//*[@id=’ext-gen32′]”;
WebElement elem = driver.findElement(By.xpath(arrow));
action.moveToElement(elem, 235, 17);
action.click().perform();
List<WebElement> sideBarElements = getElements(By
.cssSelector(“a.x-menu-item”));
for (WebElement element : sideBarElements) {
if (element.getText().equalsIgnoreCase(“Lookup Contactâ€)) {
element.click();
break;
}
}
HTML
<div id=”servicedesk” class=” x-border-panel x-border-layout-ct” style=”left: 0px; top: 65px; width: 1680px; height: 553px;”>
<div id=”navigatortab” class=” x-plain undefined sd_nav_tabpanel x-border-panel” style=”left: 0px; top: 0px; width: 1680px;”>
<div class=”support-servicedesk-navigator” id=”ext-gen32″ style=”background: rgb(229, 231, 233);”>
<table id=”ext-comp-1006″ cellspacing=”0″ class=”x-btn support-servicedesk-sb Custom9Mru mruIcon support-servicedesk-sbactive x-btn-noicon” style=”width: 250px; height: 26px;”>
<tbody class=”x-btn-small x-btn-icon-small-left”>
<tr>
<td class=”x-btn-tl”><i> </i></td>
<td class=”x-btn-tc”></td>
<td class=”x-btn-tr”><i> </i></td>
</tr>
<tr>
<td class=”x-btn-ml”><i> </i></td>
<td class=”x-btn-mc”><em class=”x-btn-split” unselectable=”on” id=”ext-gen92″><button type=”button” id=”ext-gen33″ class=” x-btn-text”><div class=”mruIcon”></div><span>Lookup Contact</span></button></em></td>
<td class=”x-btn-mr”><i> </i></td>
</tr>
<tr>
<td class=”x-btn-bl”><i> </i></td>
<td class=”x-btn-bc”></td>
<td class=”x-btn-br”><i> </i></td>
</tr>
</tbody>
</table>
</div>
<div class=”x-plain-header sd_primary_tabstrip x-unselectable” id=”ext-gen22″ style=”background: rgb(229, 231, 233); width: 1680px;”>
<div class=”x-tab-tabmenu-right” id=”ext-gen36″></div>
<div class=”x-tab-strip-wrap” id=”ext-gen25″ style=”width: 1408px; left: 250px;”>
<ul class=”x-tab-strip x-tab-strip-top” id=”ext-gen27″ style=”background: rgb(229, 231, 233);”>
<li class=” x-tab-strip-active” id=”navigatortab__ext-comp-1004″ style=”display: none;”>
<a class=”x-tab-strip-close” id=”ext-gen30″></a><a class=”x-tab-right” href=”#” id=”ext-gen31″><em class=”x-tab-left”><span class=”x-tab-strip-inner”><span class=”x-tab-strip-text “></span></span></em></a></li>
<li class=”add-tab-btn” id=”navigatortabaddTabButton”>
<a class=”x-tab-strip-close”></a><a class=”x-tab-right” href=”#” id=”ext-gen35″ style=”padding-left: 6px;”><em class=”x-tab-left” id=”ext-gen34″ style=”padding-right: 6px;”><span class=”x-tab-strip-inner”><span class=”x-tab-strip-text “></span></span></em></a></li>
<li class=”x-tab-edge” id=”ext-gen28″><span class=”x-tab-strip-text”> </span></li>
<div class=”x-clear” id=”ext-gen29″></div>
</ul>
</div>
<div class=”x-tab-strip-spacer” id=”ext-gen26″></div>
</div>
<div class=”x-plain-bwrap” id=”ext-gen23″>
<div class=”x-plain-body sd_nav_tabpanel_body x-tab-panel-body-top” id=”ext-gen24″ style=”width: 1680px; height: 521px;”>
<div id=”ext-comp-1004″ class=”” style=”width: 1680px; height: 521px;”>
<iframe id=”ext-comp-1005″ name=”ext-comp-1005″ frameborder=”0″ allow=”camera *; geolocation *; microphone *” src=”/servlet/servlet.Integration?lid=01rd00000007Ruf&ic=1&linkToken=VmpFPSxNakF4T1Mwd015MHdNVlF3TkRveE56bzBNQzR5T0RKYSx2Sm81dVNhWlBVLTRMQlMtVW01c3J1LFlXWmtNR0po&isdtp=nv&nonce=182e776daf5f434d79f1d86ca453d03c6e18161b87fd78f9c08805c6dbd4ab4b&sfdcIFrameOrigin=https%3A%2F%2Fintuit.my.salesforce.com” style=”width: 1680px; height: 521px;”></iframe>
</div>
</div>
</div>
</div>
</div>
Dropdown Html
<div id=”navigator-sbmenu” class=”x-menu x-menu-floating x-layer x-hide-offsets” style=”position: absolute; z-index: 15000; visibility: hidden; left: -10000px; top: -10000px; width: 250px;”>
<a class=”x-menu-focus” href=”#” onclick=”return false;” tabindex=”-1″ id=”ext-gen93″></a>
<ul class=”x-menu-list” id=”ext-gen94″ style=”height: 392px;”>
<li id=”x-menu-el-nav-tab-0″ class=”x-menu-list-item”>
<a id=”nav-tab-0″ class=”x-menu-item Custom103Mru userDefinedMRU 01541000002eEOg sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”https://intuit–c.na75.content.force.com/servlet/servlet.ImageServer?id=01541000002eEOg&oid=00DE0000000a8TL&lastMod=1504832300000″ class=”x-menu-item-icon Custom103Mru userDefinedMRU 01541000002eEOg mruIcon” id=”ext-gen96″><span class=”x-menu-item-text” id=”ext-gen97″>My Clients</span></a>
</li>
<li id=”x-menu-el-nav-tab-1″ class=”x-menu-list-item”>
<a id=”nav-tab-1″ class=”x-menu-item Custom91Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom91Mru mruIcon” id=”ext-gen98″><span class=”x-menu-item-text” id=”ext-gen99″>Team Summary</span></a>
</li>
<li id=”x-menu-el-nav-tab-2″ class=”x-menu-list-item”>
<a id=”nav-tab-2″ class=”x-menu-item Custom153Mru userDefinedMRU 01541000002eERQ sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”https://intuit–c.na75.content.force.com/servlet/servlet.ImageServer?id=01541000002eERQ&oid=00DE0000000a8TL&lastMod=1504833236000″ class=”x-menu-item-icon Custom153Mru userDefinedMRU 01541000002eERQ mruIcon” id=”ext-gen100″><span class=”x-menu-item-text” id=”ext-gen101″>Calendar</span></a>
</li>
<li id=”x-menu-el-nav-tab-3″ class=”x-menu-list-item”>
<a id=”nav-tab-3″ class=”x-menu-item caseMru standardObject sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon caseMru standardObject mruIcon” id=”ext-gen102″><span class=”x-menu-item-text” id=”ext-gen103″>Cases</span></a>
</li>
<li id=”x-menu-el-nav-tab-4″ class=”x-menu-list-item”>
<a id=”nav-tab-4″ class=”x-menu-item Custom37Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom37Mru mruIcon” id=”ext-gen104″><span class=”x-menu-item-text” id=”ext-gen105″>Lookup Online Account</span></a>
</li>
<li id=”x-menu-el-nav-tab-5″ class=”x-menu-list-item support-servicedesk-sbmenuitemselected”>
<a id=”nav-tab-5″ class=”x-menu-item Custom9Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom9Mru mruIcon” id=”ext-gen106″><span class=”x-menu-item-text” id=”ext-gen107″>Lookup Contact</span></a>
</li>
<li id=”x-menu-el-nav-tab-6″ class=”x-menu-list-item”>
<a id=”nav-tab-6″ class=”x-menu-item Custom67Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom67Mru mruIcon” id=”ext-gen108″><span class=”x-menu-item-text” id=”ext-gen109″>Order Search</span></a>
</li>
<li id=”x-menu-el-nav-tab-7″ class=”x-menu-list-item”>
<a id=”nav-tab-7″ class=”x-menu-item contactMru standardObject sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon contactMru standardObject mruIcon” id=”ext-gen110″><span class=”x-menu-item-text” id=”ext-gen111″>Contacts</span></a>
</li>
<li id=”x-menu-el-nav-tab-8″ class=”x-menu-list-item”>
<a id=”nav-tab-8″ class=”x-menu-item Custom123Mru userDefinedMRU 01541000001GoUv sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”https://intuit–c.na75.content.force.com/servlet/servlet.ImageServer?id=01541000001GoUv&oid=00DE0000000a8TL&lastMod=1484285285000″ class=”x-menu-item-icon Custom123Mru userDefinedMRU 01541000001GoUv mruIcon” id=”ext-gen112″><span class=”x-menu-item-text” id=”ext-gen113″>Lookup EFE</span></a>
</li>
<li id=”x-menu-el-nav-tab-9″ class=”x-menu-list-item”>
<a id=”nav-tab-9″ class=”x-menu-item Custom90Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom90Mru mruIcon” id=”ext-gen114″><span class=”x-menu-item-text” id=”ext-gen115″>My Scorecard</span></a>
</li>
<li id=”x-menu-el-nav-tab-10″ class=”x-menu-list-item”>
<a id=”nav-tab-10″ class=”x-menu-item Custom50Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom50Mru mruIcon” id=”ext-gen116″><span class=”x-menu-item-text” id=”ext-gen117″>Learning Dashboard</span></a>
</li>
<li id=”x-menu-el-nav-tab-11″ class=”x-menu-list-item”>
<a id=”nav-tab-11″ class=”x-menu-item Custom15Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom15Mru mruIcon” id=”ext-gen118″><span class=”x-menu-item-text” id=”ext-gen119″>Employee Profile Updater</span></a>
</li>
<li id=”x-menu-el-nav-tab-12″ class=”x-menu-list-item”>
<a id=”nav-tab-12″ class=”x-menu-item Custom20Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom20Mru mruIcon” id=”ext-gen120″><span class=”x-menu-item-text” id=”ext-gen121″>Bulk Policy Removal</span></a>
</li>
<li id=”x-menu-el-nav-tab-13″ class=”x-menu-list-item”>
<a id=”nav-tab-13″ class=”x-menu-item Custom39Mru sd-nav-menu-item” hidefocus=”true” unselectable=”on” href=”#”><img alt=”” src=”data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==” class=”x-menu-item-icon Custom39Mru mruIcon” id=”ext-gen122″><span class=”x-menu-item-text” id=”ext-gen123″>Lookup Online TTA Account</span></a>
</li>
</ul>
</div>
I’m writing a Python program (with Selenium) to automatically download data from a website and then log out, but cannot figure out how to get to the logout menu item, which is in a drop-down list. I’m a NOOB at this, so please bear with me.
I’ve reviewed a number of posts here to see if I could sort it out (including this one), to no avail.
Here is the HTML code; the item that renders the dropdown list is highlighted. No matter what I try, Selenium either cannot find the item I need to click or it finds the item and says it’s not clickable. How do I get the dropdown menu to appear so I can click on the “Logout” list item?
Once I get the dropdown menu to appear, I need to select the item with an ID of “logout” in the HTML code below. What is the proper way to do this?
On my page, I have 25 Links displayed inside a web table, now i have to traverse all pagination pages, like 1-25, 25-50, 50-75 etc…my specific link text can be in any pagination set, it can be on any page.
<<previous |1 – 25 of 125| next>>
If the link text matches my string, then click otherwise keep on clicking on “next” button until i find the link. Problem is i am getting “org.openqa.selenium.StaleElementReferenceException: stale element reference: stale element not found
as the Webelement is not longer in DOM. I have tried few methods but its not working.
Method 1:
List<WebElement> links = new ArrayList<WebElement>();
links = driver.findElements(By.xpath(“//table[contains(@id,’table1′)]//tr//a”));
if (links.get(i).getText().equalsIgnoreCase(MatchString)) {
links.get(0).click();
break;
}
driver.findElement(By.linkText(“next”)).click();
}
Method2:
for (int i = 1; i < links.size(); i++) {
//// links = driver.findElements(By.xpath(“//table[contains(@id,’table1′)]//tr//a”));
// links = new ArrayList<WebElement>();
// links = driver.findElements(By.tagName(“a”));
// driver.navigate().refresh();
//
//
// if (links.get(i).getText().trim().equalsIgnoreCase(MatchString.trim())) {
// links.get(i).click();
// System.out.println(“Link is clicked”);
// break;
// }
//
// else {
// driver.findElement(By.linkText(“next”)).click();
//
// }
// }
#​687 — May 9, 2024 Read on the Web JavaScript Weekly Development Notes from xkcd’s ‘Machine’ — I bet many…
In today’s tech-driven world, the ability to visualize data spatially has been vital for various industries. Enter ArcGIS, a Geographic…
In the mosaic of education, diversity is the common thread that weaves through every classroom. Students come with unique backgrounds,…
Welcome to the inaugural installment of our Universal Design Series, where we embark on a journey to explore the vital…
Perficient’s Giving ERG was established in 2021, as a way for employees to bond over philanthropy and inspire generosity. Shortly…
MingleJS is a helper for using Vue and React components in a Livewire or Filament application. Created by Joao Patricio,…
Security researchers have revealed new critical vulnerabilities in F5’s Next Central Manager, posing severe risks to organizational cybersecurity. These Next…
The International Baccalaureate Organization (IBO) confirmed a hacking incident, while clarifying that no ongoing exam papers were leaked despite claims…
Polish government institutions have been targeted as part of a large-scale malware campaign orchestrated by a Russia-linked nation-state actor called APT28.…
Researchers have detailed a Virtual Private Network (VPN) bypass technique dubbed TunnelVision that allows threat actors to snoop on victim’s network traffic…
The world’s 28 million software developers are writing the foundations of our future, propelling innovation for their organizations through lines…
Heroku is a fully managed platform as a service (PaaS) solution that makes it straightforward for developers to deploy, operate,…