Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Used for questions about using Selenium WebDriver, a browser automation framework frequently used to automate testing in a browser.
1
vote
how to locate a href link inside anchor tag in selenium java?
To get the href attribute value you can use this,
WebElement myLink = driver.findElement(By.xpath("//a[contains(@href,'Electronics')]"));
String href = myLink.getAttribute("href");
OR
WebElement myLi …
1
vote
Selenium - Web driver code is not working after restarting the system
You can try any or all of the below mentioned points to check and resolve the issue.
Check if your project is a Java Project and not a General Project.
Ensure that your class file (.java file) is in …
1
vote
Selenium - sendKeys() function is not working for file upload
From the sample code it can be seen that you are trying to pass file name for a file upload (<input type="file">) element.
driver.findElement(By.xpath("//*[@id='fileupload']")).sendKeys("filupload");
…
1
vote
Accepted
Webdriver auto-filtering results
As per the rules of W3C custom elements are registered by script using document.registerElement(). Now, it may be possible that they are declared or created before their definition is registered by t …
1
vote
What do you assert in a test that causes navigation?
You can try to assert a text in the page you are navigating to.
You can also assert page/window title.
Another way to assert whether an image or an element specific to that page is present or not.
-3
votes
Selenium test cases are failing due to page load time
I thin you should try and increase the wait time. You've added Thread.sleep("2000");, which is 2 seconds.
BUT
do all your pages load within 2 seconds?
I think you should try and add some more wai …
1
vote
How to find out which languages are supported by a website?
With websites supporting multiple languages and the language being select-able from the front-end There is always a list element (drop down) field in the web page.
You can find the list element and fe …
0
votes
How to select two and three check box in a table
You can use this code to select random number of checkboxes,
List<WebElement> a = driver.findElements(By.id("#checkbox"));
Random rand = new Random(); //instance of random class
int int_random = rand. …
0
votes
Selenium - invalid selector ui-sref
This is my selenium code with Java that worked:
try {
WebDriver driver;
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "//chromedriver");
…
0
votes
How to grab other data inside class with Selenium
I tried this with Java+Selenium and it worked,
HTML:
<html>
<body>
<svg aria-label="Unlike" class="_8-yf5 " color="#ed4956" fill="#ed4956" height="24" role="img" viewBox="0 0 48 48" width="24"><p …
-1
votes
Keyboard shortcuts using Selenium
If the sendKeys() method of Selenium isn't working for you I suggest you try the Robot framework for using keyboard shortcuts.
You can do something like;
Robot robot = new Robot();
Thread.sleep(1000); …
0
votes
Window handling in java selenium
This piece of code did the trick for me,
try {
WebDriver driver;
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "//chromedriver");
driver = new ChromeDriver …
0
votes
Is there a way to record a video of my Selenium automation with Python?
You can use libraries like pyautogui and numpy to write code to record screen by taking screenshots and then adding them into a video file.
I haven't tried is myself, but with a quick search on the in …
2
votes
How to read and pass multiple data from excel in selenium
Here is a little something with Selenium, Java and JXL library to get you started,
try {
Workbook workbook = Workbook.getWorkbook(new File(System.getProperty("user.dir") + "//file.xls"));
Shee …
1
vote
Verify element is visible using selenium and java
As per the description in your question I understand that in your web page there are several <span> to display discount text.
From these you want to get those <span> that actually have some text withi …