2
votes
Accepted
Selenium Webdriver : Trying to get text, but specific class present
Based on the information you shared, I was able to get the Transaction Number with this line of code:
driver.findElement(By.xpath("//span[@class='status-success' and @data-v-5d062b04 ='']//...
1
vote
Is there any way to trigger before Method only for specific test methods
You could create another method that does not have the @Test or @BeforeMethod/@BeforeTest tags and then just call that method within the tests themselves.
Or
You could use the @DataProvider tag to ...
1
vote
Accepted
Element is not clicked even after explicit wait
In the HTML bit that you have shared in the question, there is no <li> element (//li[@role='option']).
Hence this line threw error for me:
WebElement defaultValue = driver.findElements(By.xpath(&...
1
vote
Accepted
Getting value from data-value (webdriver selenium / java)
QA automation engineers face this issue while automating user interface testing scenarios.
Below is the code that can be used to fetch the value of data-val="9":
String text = driver....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
java × 1384selenium-webdriver × 1155
automated-testing × 470
testng × 155
selenium2 × 91
cucumber × 71
xpath × 70
browser-automation × 64
appium × 58
test-automation-framework × 49
junit × 48
javascript × 47
page-objects × 45
eclipse × 36
chromedriver × 34
jmeter × 33
maven × 21
android × 19
mobile-automation × 19
python × 18
selenium3 × 17
firefoxdriver × 17
assert × 17
test-design × 16
unit-tests × 16