I'm trying to click on a link after the text "action". The HTML is:
<div _ngcontent-c10="" class="col-md-3" style="padding-left: 20px;">
<div _ngcontent-c10="" class="card" style="width:100% !important">
<div _ngcontent-c10="" class="headerText">FLOATS & MOVE</div>
<hr _ngcontent-c10="">
<div _ngcontent-c10="" class="text1">action</div>
<div _ngcontent-c10="" class="text2">
<a _ngcontent-c10="" class="waves-light" data-toggle="modal" mdbwaveseffect="" style="margin-right: -25%;" type="button">
<img _ngcontent-c10="" src="assets/co-assets/icon-down-arrow-med.png">
</a>
</div>
<div _ngcontent-c10=""class="text1">from</div>
<div _ngcontent-c10="" class="text2">
<a _ngcontent-c10="" class="waves-light" data-toggle="modal" mdbwaveseffect=""
style="margin-right: -25%;" type="button">
<img _ngcontent-c10="" src="assets/co-assets/icon-down-arrow-med.png">
</a>
</div>
<div _ngcontent-c10="" class="text1">to</div>
<div _ngcontent-c10="" class="text2">
<a _ngcontent-c10="" class="waves-light" data-toggle="modal" mdbwaveseffect="" style="margin-right: -25%;" type="button">
<img _ngcontent-c10="" src="assets/co-assets/icon-down-arrow-med.png">
</a>
</div>
The XPath I've used is:
//div[./text()='action']/following-sibling::div[1]/a
I've waited explicitly for 20 seconds with the condition ElementToBeClickable as follows:
wait.until(ExpectedConditions.elementToBeClickable(actionDropDown));
The interesting thing is I'm not getting TimeOutException.
Seems like Webdriver unable to click on the element.Try the following options to click.
Use Action class
WebElement ele=driver.findElement(By.xpath("//div[#class='text1'][contains(.,'action')]/following-sibling::div[1]/a"));
Actions action=new Actions(driver);
action.moveToElement(ele).click().build().perform();
Use Javascripts executor
WebElement ele=driver.findElement(By.xpath("//div[#class='text1'][contains(.,'action')]/following-sibling::div[1]/a"));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", ele);
Related
I have two objects on the page with same html. Only one of the element's parent tag doesn't have same class name. When I try using not(contains()) it still shows both elements
below is the xpath I tried and still it is detecting both buttons and always clicking on the second button.
//div[contains(#class,"jss") and
not(contains(#class,"canvas-image-export"))]//button[contains(.,'Connected')]
below is the code for first button named Connected where I am interested to get
<div class="jss203">
<div class="MuiTabs-root jss244">
<div class="MuiTabs-scroller MuiTabs-fixed" style="overflow: hidden;">
<div class="MuiTabs-flexContainer" role="tablist">
<button class="MuiButtonBase-root MuiTab-root MuiTab-textColorPrimary Mui-selected" tabindex="0" type="button" role="tab" aria-selected="true"><span class="MuiTab-wrapper">Overview</span><span class="MuiTouchRipple-root"></span></button>
<button class="MuiButtonBase-root MuiTab-root MuiTab-textColorPrimary" tabindex="-1" type="button" role="tab" aria-selected="false"><span class="MuiTab-wrapper">Data Sources</span><span class="MuiTouchRipple-root"></span></button>
<button class="MuiButtonBase-root MuiTab-root MuiTab-textColorPrimary" tabindex="-1" type="button" role="tab" aria-selected="false"><span class="MuiTab-wrapper">Connected</span><span class="MuiTouchRipple-root"></span></button>
</div>
</div>
</div>
</div>
below is the code for second button named Connected which I should not click on
<div class="jss197 canvas-image-export">
<span class="" data-testid="componentContainer">
<div class="MuiTabs-root jss244">
<div class="MuiTabs-scroller MuiTabs-fixed" style="overflow: hidden;">
<div class="MuiTabs-flexContainer" role="tablist">
<button class="MuiButtonBase-root MuiTab-root MuiTab-textColorPrimary Mui-selected" tabindex="0" type="button" role="tab" aria-selected="true"><span class="MuiTab-wrapper">Overview</span><span class="MuiTouchRipple-root"></span></button>
<button class="MuiButtonBase-root MuiTab-root MuiTab-textColorPrimary" tabindex="-1" type="button" role="tab" aria-selected="false"><span class="MuiTab-wrapper">Data Sources</span><span class="MuiTouchRipple-root"></span></button>
<button class="MuiButtonBase-root MuiTab-root MuiTab-textColorPrimary" tabindex="-1" type="button" role="tab" aria-selected="false"><span class="MuiTab-wrapper">Connected</span><span class="MuiTouchRipple-root"></span></button>
</div>
</div>
</div>
</span>
</div>
TIA
Your problem here is that you are looking on the upper parent node <div class="jss197 canvas-image-export"> vs <div class="jss203"> while there is another element there <div class="MuiTabs-root jss244"> or <div class="MuiTabs-root jss244"> and it is also matching your XPath //div[contains(#class,"jss") and not(contains(#class,"canvas-image-export"))]//button[contains(.,'Connected')].
So, to make your XPath work you need to add one more detail: not contains MuiTabs-root class, as following:
//div[contains(#class,"jss") and not(contains(#class,"canvas-image-export")) and not(contains(#class,"MuiTabs-root"))]//button[contains(.,'Connected')]
To get only first div buttons, you can exclude the span tag for the second element. Using following xpath you can get that.
//div[starts-with(#class,'jss')][not(span[#data-testid='componentContainer'])]//button[contains(.,'Connected')]
Or
//div[starts-with(#class,'jss')][not(span)]//button[contains(.,'Connected')]
I'm facing a problem with a stale element under the shadow DOM, scenario below:
hover to the video and the dock is shown and vice versa
HTML Dom changes from not hovering to hovering and vice versa:
The below html is for not hovering.
<div class="base overlay hidden" style="position:absolute;top:80px;left:139px;height:387px;width:516px;"><div class="downloads"><div class="hide-btn" id="hide-widget">
</div>
<ul class="main main-panel">
<li class="panel">
<span class="select" id="preferred-select" data-selected-value="High">Preferred quality: High</span>
<a class="download-btn" id="download-main" title="DOWNLOAD">
<span>DOWNLOAD</span>
</a>
</li>
<li class="message-panel">
<a class="message" id="showhide-all"></a>
</li>
</ul>
<!-- Progress box for content script -->
<div class="tooltip-box">
<div class="play-and-progress-box" hidden="">
<div class="progress-box">
<div class="progress-bar">
<div class="bar"></div>
</div>
<div class="percent"></div>
</div>
<button class="play-now-btn" id="play-now">
<span class="play-now-play-icon">▶</span> Play now
</button>
</div>
<div class="tooltip bleft">
Click to <b>Play now</b> to watch downloading video now!
<form action="" class="not-show">
<input type="checkbox" name="vehicle" value="abc" id="play-now-not-show-check">
<label for="play-now-not-show-check">Do not show again</label>
</form>
<span class="closebtn" id="close-play-now-tooltip">+</span>
</div>
</div>
<div id="downloads"></div>
<div class="mobile-btn">
<div id="open-mobile">
<div class="tooltip">Mobile</div>
</div>
</div>
<div id="open-pip" class="pip-btn">
<div class="tooltip">Pin</div>
</div>
<div id="switch-light" class="light-btn">
<div class="tooltip">Lights off</div>
</div>
<div id="skipping_ads" class="skipping-ads-btn" style="background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzIDBDMTIuNCAwIDEyIDAuNCAxMiAxVjEzQzEyIDEzLjYgMTIuNCAxNCAxMyAxNEMxMy42IDE0IDE0IDEzLjYgMTQgMTNWMUMxNCAwLjQgMTMuNiAwIDEzIDBaIiBmaWxsPSIjREVERERBIi8+CjxwYXRoIGQ9Ik0zLjM5OTk5IDAuNTk5OTk4QzIuOTk5OTkgMC4xOTk5OTggMi41IDAgMiAwQzEuNyAwIDEuNTAwMDEgNy41OTk1OWUtMDcgMS4yMDAwMSAwLjIwMDAwMUMwLjUwMDAxMiAwLjUwMDAwMSAwIDEuMiAwIDJWMTJDMCAxMi44IDAuNTAwMDEyIDEzLjUgMS4yMDAwMSAxMy44QzEuNDAwMDEgMTMuOSAxLjcgMTQgMiAxNEMyLjUgMTQgMi45OTk5OSAxMy44IDMuMzk5OTkgMTMuNEw4LjM5OTk5IDguNEM5LjE5OTk5IDcuNiA5LjE5OTk5IDYuNCA4LjM5OTk5IDUuNkwzLjM5OTk5IDAuNTk5OTk4WiIgZmlsbD0iI0RFREREQSIvPgo8L3N2Zz4K");">
<div class="tooltip">Disable Auto skip ads</div>
</div>
<div class="skipping-ads-tooltip">
<div class="skipping-ads-tooltip-wand-block">
<div class="skipping-ads-tooltip-wand"></div>
</div>
<div class="skipping-ads-tooltip-block">
<div class="skipping-ads-tooltip-title">Auto skip ads</div>
<div class="skipping-ads-tooltip-content">Cốc Cốc can skip video ads automatically for you. Do you want to enable it now?</div>
<div class="skipping-ads-tooltip-notice">This is not an ad blocker, it just automates the process of clicking on the "Skip Ad" button</div>
</div>
<div class="skipping-ads-tooltip-btn">
<div id="skipping-ads-btn-cancel" class="skipping-ads-tooltip-btn-cancel">
Cancel
</div>
<div id="skipping-ads-btn-ok" class="skipping-ads-tooltip-btn-ok">
Yes, enable
</div>
</div>
</div>
<div class="mobile-box hidden">
<div class="mobile-content-box">
<div class="mobile-content-column-box">
<div class="mobile-content-column">
<div class="mobile-content mobile-header first">
<span class="mobile-instruction-text">
<span class="step-number">1</span>
Open Cốc Cốc Mobile
</span>
</div>
<div class="mobile-content mobile-instructions">
<img src="" alt="Instruction" class="instruction-image">
</div>
</div>
<div class="mobile-content-column">
<div class="mobile-content mobile-header second">
<span class="mobile-instruction-text">
<span class="step-number">2</span>
Scan QR code
</span>
</div>
<div class="mobile-switch-box">
<div class="switch">
<div class="switch-field">
<input type="radio" id="switch-video" name="send-type" value="video" checked="">
<label for="switch-video">Video</label>
<input type="radio" id="switch-audio" name="send-type" value="audio">
<label for="switch-audio">Audio</label>
</div>
</div>
</div>
<div class="mobile-content mobile-qrcode">
<div class="qrcode loading"></div>
</div>
</div>
</div>
<div class="mobile-content mobile-footer">
<span class="footer-text"> Don't have Cốc Cốc Browser on mobile? </span>
<div class="download-web-stores">
<div class="stores google-play" id="google-play">
</div>
<div class="stores app-store" id="app-store">
</div>
</div>
</div>
</div>
</div></div></div>
After hovered, the change is:
<div class="base overlay" style="position:absolute;top:80px;left:139px;height:387px;width:516px;"><div class="downloads"><div class="hide-btn" id="hide-widget">
</div>
<ul class="main main-panel">
<li class="panel">
<span class="select" id="preferred-select" data-selected-value="High">Preferred quality: High</span>
<a class="download-btn" id="download-main" title="DOWNLOAD">
<span>DOWNLOAD</span>
</a>
</li>
<li class="message-panel">
<a class="message" id="showhide-all"></a>
</li>
</ul>
<!-- Progress box for content script -->
<div class="tooltip-box">
<div class="play-and-progress-box" hidden="">
<div class="progress-box">
<div class="progress-bar">
<div class="bar"></div>
</div>
<div class="percent"></div>
</div>
<button class="play-now-btn" id="play-now">
<span class="play-now-play-icon">▶</span> Play now
</button>
</div>
<div class="tooltip bleft">
Click to <b>Play now</b> to watch downloading video now!
<form action="" class="not-show">
<input type="checkbox" name="vehicle" value="abc" id="play-now-not-show-check">
<label for="play-now-not-show-check">Do not show again</label>
</form>
<span class="closebtn" id="close-play-now-tooltip">+</span>
</div>
</div>
<div id="downloads"></div>
<div class="mobile-btn">
<div id="open-mobile">
<div class="tooltip">Mobile</div>
</div>
</div>
<div id="open-pip" class="pip-btn">
<div class="tooltip">Pin</div>
</div>
<div id="switch-light" class="light-btn">
<div class="tooltip">Lights off</div>
</div>
<div id="skipping_ads" class="skipping-ads-btn" style="background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNCAxNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzIDBDMTIuNCAwIDEyIDAuNCAxMiAxVjEzQzEyIDEzLjYgMTIuNCAxNCAxMyAxNEMxMy42IDE0IDE0IDEzLjYgMTQgMTNWMUMxNCAwLjQgMTMuNiAwIDEzIDBaIiBmaWxsPSIjREVERERBIi8+CjxwYXRoIGQ9Ik0zLjM5OTk5IDAuNTk5OTk4QzIuOTk5OTkgMC4xOTk5OTggMi41IDAgMiAwQzEuNyAwIDEuNTAwMDEgNy41OTk1OWUtMDcgMS4yMDAwMSAwLjIwMDAwMUMwLjUwMDAxMiAwLjUwMDAwMSAwIDEuMiAwIDJWMTJDMCAxMi44IDAuNTAwMDEyIDEzLjUgMS4yMDAwMSAxMy44QzEuNDAwMDEgMTMuOSAxLjcgMTQgMiAxNEMyLjUgMTQgMi45OTk5OSAxMy44IDMuMzk5OTkgMTMuNEw4LjM5OTk5IDguNEM5LjE5OTk5IDcuNiA5LjE5OTk5IDYuNCA4LjM5OTk5IDUuNkwzLjM5OTk5IDAuNTk5OTk4WiIgZmlsbD0iI0RFREREQSIvPgo8L3N2Zz4K");">
<div class="tooltip">Disable Auto skip ads</div>
</div>
<div class="skipping-ads-tooltip">
<div class="skipping-ads-tooltip-wand-block">
<div class="skipping-ads-tooltip-wand"></div>
</div>
<div class="skipping-ads-tooltip-block">
<div class="skipping-ads-tooltip-title">Auto skip ads</div>
<div class="skipping-ads-tooltip-content">Cốc Cốc can skip video ads automatically for you. Do you want to enable it now?</div>
<div class="skipping-ads-tooltip-notice">This is not an ad blocker, it just automates the process of clicking on the "Skip Ad" button</div>
</div>
<div class="skipping-ads-tooltip-btn">
<div id="skipping-ads-btn-cancel" class="skipping-ads-tooltip-btn-cancel">
Cancel
</div>
<div id="skipping-ads-btn-ok" class="skipping-ads-tooltip-btn-ok">
Yes, enable
</div>
</div>
</div>
<div class="mobile-box hidden">
<div class="mobile-content-box">
<div class="mobile-content-column-box">
<div class="mobile-content-column">
<div class="mobile-content mobile-header first">
<span class="mobile-instruction-text">
<span class="step-number">1</span>
Open Cốc Cốc Mobile
</span>
</div>
<div class="mobile-content mobile-instructions">
<img src="" alt="Instruction" class="instruction-image">
</div>
</div>
<div class="mobile-content-column">
<div class="mobile-content mobile-header second">
<span class="mobile-instruction-text">
<span class="step-number">2</span>
Scan QR code
</span>
</div>
<div class="mobile-switch-box">
<div class="switch">
<div class="switch-field">
<input type="radio" id="switch-video" name="send-type" value="video" checked="">
<label for="switch-video">Video</label>
<input type="radio" id="switch-audio" name="send-type" value="audio">
<label for="switch-audio">Audio</label>
</div>
</div>
</div>
<div class="mobile-content mobile-qrcode">
<div class="qrcode loading"></div>
</div>
</div>
</div>
<div class="mobile-content mobile-footer">
<span class="footer-text"> Don't have Cốc Cốc Browser on mobile? </span>
<div class="download-web-stores">
<div class="stores google-play" id="google-play">
</div>
<div class="stores app-store" id="app-store">
</div>
</div>
</div>
</div>
</div></div></div>
The code to get the Element after mouse hover as below:
public static WebElement getElementFromShadow(String jsPath) {
WebElement element = null
WebDriver driver = DriverFactory.getWebDriver()
JavascriptExecutor jse = ((driver) as JavascriptExecutor)
int attempts = 0;
while (attempts < 5) {
try {
element = ((jse.executeScript('return ' + jsPath)) as WebElement)
if (element != null) {
break;
}
else {
WebDriverWait wait = new WebDriverWait(driver, 10, 100);
element = wait.until(ExpectedConditions.elementToBeClickable(((jse.executeScript('return ' + jsPath)) as WebElement)))
}
} catch (Exception e) {
e.printStackTrace()
}
attempts++
Thread.sleep(2000)
}
return element
}
but when run it, I got org.openqa.selenium.StaleElementReferenceException: stale element reference: stale element not found
(Session info: chrome=91.0.4472.124)
PS: the above code works fine with the normal shadow element(No DOM is changed).
Could anyone know any idea/solution to solve the issue, thank you in advance!
Want to obtain the xpath for the elements from a drop-down menu (refer the image),
Tried with the following,
.//div[#class='styles__dropDownList___1PunQ styles__dropDownList___2fbeV'] with this only the drop down is getting selected
No luck with,
.//div[#class='styles__dropDownList___1PunQ styles__dropDownList___2fbeV' and data-test-id='option_0']
//div[#class='styles__dropDownList___1PunQ styles__dropDownList___2fbeV' and text()='Hyg']
//div[#class='styles__dropDownList___1PunQ styles__dropDownList___2fbeV' and contains(#text,'Hyg')]
Element Section:
<div class="dd-menu-items">
<ul class="dd-items-center">
<div class="styles__dropDownList___1PunQ styles__dropDownList___2fbeV">
<div class="styles__optionListItem___1SA75" role="button" data-test-id="option_0" tabindex="0">
<div class="styles__optionDiv___o55ex">
<div>Hyg</div>
</div>
</div>
<div class="styles__optionListItem___1SA75" role="button" data-test-id="option_1" tabindex="0">
<div class="styles__optionDiv___o55ex">
<div>Kay</div>
</div>
</div>
<div class="styles__optionListItem___1SA75" role="button" data-test-id="option_2" tabindex="0">
<div class="styles__optionDiv___o55ex">
<div>Kay</div>
</div>
</div>
<div class="styles__optionListItem___1SA75" role="button" data-test-id="option_3" tabindex="0">
<div class="styles__optionDiv___o55ex">
<div>Perio</div>
</div>
</div>
<div class="styles__optionListItem___1SA75" role="button" data-test-id="option_4" tabindex="0">
<div class="styles__optionDiv___o55ex">
<div>Smiles</div>
</div>
</div>
<div class="styles__optionListItem___1SA75" role="button" data-test-id="option_5" tabindex="0">
<div class="styles__optionDiv___o55ex">
<div>Smiles</div>
</div>
</div>
</div>
</ul>
</div>
To click the desired element you should first open the dropdown box by clicking on it and after that to click on the element.
Since you can select it uniquely only according to the text the element contains you should use //div[contains(text(),'Hyg')] or //div[text()='Hyg']
I have a valid xpath but when i use the same Xpath in java to store the WebElements, it gives an error.
It is related to the syntax error.Below is the error
syntax error on token ""]//div/div/button[#id="",
( expected
- Syntax error on token "header", delete this token
- Syntax error on token ""]"", ) expected
below is the httml code
<div id="header-wrap-container">
<div id="header-wrap" style="position: fixed;">
<div class="bredcrumDJV">
<div class="container">
<div class="row">
<div class="col-md-5 col-lg-6">
<div class="col-md-7 col-lg-6 col-xs-12 applySec">
<div class="pull-right hidden-xs">
<button id="applybtn-2" class="btn btn-primary btn-lg dice-btn apply disableButton" type="button" data-toggle="modal" data-target="#cover-resume-modal">Apply Now</button>
<div class="hidden-xs btn-group btn-group-lg">
<div class="visible-xs btn-group btn-group-lg btn-block">
<input id="partnerSurveyURL" value="https://partner.techpapers.com/interstitial/interstitial.aspx?promo=111186" type="hidden"/>
</div>
<div class="visible-xs">
<button id="applybtn-2" class="btn btn-primary btn-lg dice-btn apply disableButton" type="button" data-toggle="modal" data-target="#cover-resume-modal">Apply Now</button>
<div class="hidden-xs btn-group btn-group-lg">
<div class="visible-xs btn-group btn-group-lg btn-block">
<input id="partnerSurveyURL" value="https://partner.techpapers.com/interstitial/interstitial.aspx?promo=111186" type="hidden"/>
</div>
<ul class="list-inline details pull-right djvReport hidden-xs" style="margin-top: 10px; clear: both;">
</div>
</div>
</div>
</div>
</div>
<!-- START REPORT MODAL -->
xpath is .//*[#id="header-wrap-container"]//div/div/button[#id="applybtn-2"]
inserted same xpath in java program.
public class FileUpload {
#Test()
public void checkAlertWindow() throws InterruptedException
{
System.setProperty("webdriver.gecko.driver", "C:\\geckodriver\\geckodriver.exe");
WebDriver webdriver = new FirefoxDriver();
webdriver.get("https://www.dice.com/jobs/detail/Mobile-Test-Automation-Engineer-Etouch-Systems-Corp-Fremont-CA-94555/etouch/734212?icid=sr2-1p&q=NightWatch,Selenium&l=Fremont");
//By bye = By.xpath(".//*[#id="header-wrap-container"]");
// + "/button[#id="applybtn-2"]");
//By b = By.xpath(".//*[#id="header-wrap-container"]");
// webdriver.findElement(By.xpath(".//*[#id="header-wrap-container"]"));
WebElement myDynamicElement = (new WebDriverWait(webdriver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.id("header-wrap-container")));
System.out.println(myDynamicElement.getText());
By byeid = By.id("header-wrap-container");
webdriver.findElement(By.xpath(" .//*[#id="header-wrap-container"]//div/div/button[#id="applybtn-2"]"));
}
}
why the program gives an error ?
You need to either escape the " inside your statement or use '
Try this:
webdriver.findElement(By.xpath(" .//*[#id=\"header-wrap-container\"]//div/div/button[#id=\"applybtn-2\"]"));
The table is dynamically generated and cells looks like
<div class="tableRow">
<input name="fileExt" type="hidden" value="complete">
<div class="tableCell rbpCheckBox">
<input data-index="0" name="SelectItem" type="checkbox" class="check" value="150909_ACTG_01_scyther_WD14R05C12.150910010134">
<input name="SelectPFolderName" type="hidden" value="P_0_2015-09-10-010132_master_ac-analysis_v2.3.0">
</div>
<div class="tableCell accordion-toggle cursor-pointer" data-toggle="collapse" data-target="#collaspseDiv_150909_ACTG_01_scyther_WD14R05C12_150910010134">
<p class="ellipsis rbpName" title="150909_ACTG_01_scyther_WD14R05C12">
150909_ACTG_01_scyther_WD14R05C12
</p>
<input type="hidden" name="formatted_run_name" id="150909_ACTG_01_scyther_WD14R05C12.150910010134"
value="150909_ACTG_01_scyther_WD14R05C12">
</div>
<div class="tableCell">
<span class="rbpStatus rbpStatusPadding" title="multichunk analysis pending at master">
<img src=" done.png " title="Done" class="runStatusImgTag">
</span>
</div>
<div class="tableCell">
<p class="rbpStatus">
scyther
</p>
</div>
<div class="tableCell">
<p class="rbpStatus">
2015-09-10 01:01:35
</p>
</div>
</div>
The reason why I have to locate the cell by value is because I would like to use it as confirmation that element is present on the page and we are ready to next step\action in the test-case, so I have to wait until some element will be displayed on the page and decided to wait for this cell
<div class="tableCell">
<p class="rbpStatus">
scyther
</p>
</div>
I'm trying to use something like
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "p.rbpStatus[contains('scyther')]")))
css selectors do not support contains function.
To wait for -
<div class="tableCell">
<p class="rbpStatus">
scyther
</p>
</div>
Try this:
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, "//p[contains(#class,'rbpStatus') and contains(text(),'scyther')]")))