New answers tagged

0

Can u help on 2 & 3 concerns ..Thanks for the help @Klynt @Blub


0

Depending on what you are testing (i.e. the actual process of using the upload control, or just the ability to upload / validate a file) you can skip the upload popup entirely. This also means you don't need autoit (which will mean you can run the tests on unattended (locked) machines. e.g. Generally any upload button will be something like the below when ...


0

For actions on a component or page that can take some time to load, using sleep isn't very optimal or recommended. If you're able to look for and find a webelement related to this popup, you can wait for that webelement to be clickable, present, visible, ... Using this you can set a maximum time duration for the wait but once the element is found and ...


0

Per our experiences, the faster orders as follow. ID/Name CSS Xpath ...


0

Jainam is right you should try to downgrade the Edge Version. But I have still doubts whether this should working: Issues with edge browser Could you please afterwards share your comment which version is working for your? Because we are also facing same issues. Thanks!


0

Try to find the unique string from attribute value and use xpath //span[contains(@attribute, 'unique string')]


0

Assuming "*total_rows" is unique and constant - I think this should work to get to the span: "//span[contains(@id, 'total_rows')]"


0

It works well with me. From the error, It seems the issue is with version compatibility. Verify that version of MicrosoftEdgeBrowser is matching with the version of MicrosoftWebDriver. For eg. If my MicrosoftEdgeBrowser is : "Microsoft EdgeHTML 16.16299" then MicrosoftWebDriver's version should also be same (i.e. #16299), MicrosoftWebDriver's version ...


0

How do I prioritize 2 test cases out of 5? The code below is not working: @Test public void WebStudentLogin() { System.out.println("Student login through web"); } @Test(priority=1) public void MobileStudentLogin() { System.out.println("Student login through mobile"); } @Test(priority=1) // dependsOnMethods() ...


0

Of course you can test with real devices (iPhone) but you need Appium (I suppose you don't want to spend amount of money for e.g. saucelabs) We tested this in our company´s project furthermore let me say that for running iPhone you also need an Apple Mac. Furthermore you will need: Ecclipse Appium XCode TestNG ... There are some good tutorials: Toolsqa-...


1

Based on my experience I would recommend Report Portal https://reportportal.io/ This is a standalone opensource tool powered with ML/AI and allows you to: Keep historical data for your tests Create dashboards with test automation metrics Perform test result analysis with assigning a categories for failures (very helpful for finding a process bottlenecks) ...


0

You are using the driver object before actually creating its instance. So when you say driver.FindElement(), the driver instance is null, so the execution is throwing a Null Pointer Exception You can move the below lines into your f() method to fix the error. So your f() will look like the below. public void f() { try { driver....


0

You define a class property which tries to initialize with a driver that does not yet exist. So the driver is NULL and you get a NullPointerException. You could move the WebElements to the test method or assign the value after the driver has been set in the beforeMethod construccionMenu = driver.findElement(By.xpath("//li[@data-url='/Construccion_reparacion'...


0

If you don't set priority by default, the method will have a priority of zero. When you have multiple methods with the same priority they will be run in alphabetical order.


1

Solution for Java, Python, Ruby, JS, Protractor https://help.applitools.com/hc/en-us/articles/360007189411--Chrome-is-being-controlled-by-automated-test-software-notification


0

Thanks Kate, i tried as you suggested the widget is configured. Here is the first of each row is different.First of first row---- 36 , First of second row -------37. id is different which will make the date '2' as unique. I tried with--- //*[@id="UserDetails.EffectiveDate_DDD_C_mt"]/tbody/tr/td[contains(text(), '2')] //td[@id='UserDetails....


1

Your xpath is doing exactly what it is supposed to do: return every <td> element descended from an element with id="UserDetails.EffectiveDate_DDD_C_mt" If you wish to select only the 2nd of the current month you can use one of these methods: td[text() = '2'] - this will work if there is no white space in the element text and the element for the 2nd ...


1

My 5 cents... First and most important point - testing is not just the responsibility of the QA's but every member of the Scrum team. Keeping that in mind, testing in Agile should be continuous. This is applicable to Regression testing as well. We followed the below approach to convert our manual regression pack to a continuous testing model. Identify ...


0

This happens because of your application behavior. You can try with below code: Actions action =new Actions(driver); driver.findElement(By.xpath("")).sendkeys("textvalue"); action.sendkeys("Keys.TAB");


0

You can use the below method code: public void clickonRandomCheckBox() { List<WebElement> checkboxes = driver.findElements(By.xpath("//input[@type='checkbox']")); Random ram=new random.nextInt(1,3); if(!checkboxes.get(ram).isSelected) { checkboxes.get(ram).click(); } }


4

You have automation regression suite. You are working in agile. Cost of running regression daily is close to zero (you have build agents and CI/CD working). You can add value to developers by finding regression bugs the same day they were created. You can decrease cost of fixing bugs. Yet you say there is no sense in running it daily/weekly. There is. And ...


2

You can use findElements to have a list of checkboxes then you simply have to pick a random element: List<WebElement> checkboxes = driver.findElements(By.cssSelector(".myCheckboxClass")); WebElement randomCheckbox = checkboxes.get(new Random().nextInt(list.size())); Note: It assumes some element will be found by the locator - if no element is found, ...


0

I think you're going to have to add an explicit wait, the question is what to target. I've had a similar problem before, maybe my solution will help you. The page I was testing had a textbox, and when the page was done loading, it would select this textbox. If this selection occurred in the middle of Selenium entering text into the textbox, that would ...


2

Regression Testing was one of the core phases of traditional waterfall development. It meant that after the (often long) development phase was finally through, all the pieces of the new system or new version were tied together, making sure everything worked. Maybe one or twice a year or once a quarter. Taking a few weeks to do it was ok for that business ...


4

It depends on the execution time of the automated test suite - if it's few minutes then it can be run after each new commit - when new changes are introduced to the code-base. If it takes longer then you can run it at the end of each sprint or even just before the new version of application in question goes to the verification / validation stage. It should ...


1

Just a minor point, instead of using xpath it'll be good if you use tagName in this scenario to find all the links. Something like this: driver.findElements(By.tagName("a")).size();


0

Try to take xpath manually and place it in the xpath. I've tried it for Selenium IDE and it worked. If not try to get the text. driver.findElements(By.xpath("//*[contains(text(),'English (UK)')]")); Please define the xpath properly, I haven't added it in here properly


0

Best Approach would be to Use Actions class in this case. The Element you need to interact with after the download bar is visible will be accessible with Actions class methods such as moveToElement(). This will save you the hassle of switching tabs and is a more neat approach.


0

The best method in my opinion will be to explore Groups in TestNG. You can mark the 500 Test Cases in Regressions as below : @Test(priority=1, groups={"Regression"}) public void testCaseOne() { } In your testNG XML, include Group Tag to Run these testCases. First mark all the Test Cases as per the need and then generate testNG XML by Right-Clicking on ...


0

How about we enter the xPath ourselves using li tag and text() ? For Example -: //li[contains(text(),'English (UK) - dd/mm/yyyy')]


0

I see a google chrome notification there. You need to first handle/disable that notification first. To do that, you can use the following code snippet when initializing a browser import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; . . . ChromeOptions cOptions = new ChromeOptions(); System.setProperty("webdriver....


0

DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("automationName", automationName); capabilities.setCapability("deviceName", deviceName); capabilities.setCapability("udid", udid); capabilities.setCapability("platformName", platformName); capabilities.setCapability("...


1

Issue found with JAR mappings to the current project. Instead of importing external JARs to classpath in Build Path, it got imported to Modulepath. Rearranging JARs solved the issue.


0

The trick is to flip the driver into NATIVE_APP mode (this seemed a bit dubious since I have a normal webpage, but it worked) Here's a test console app for dot net framework 4. On some phones 'Allow' might be 'ALLOW' and the XPath matching is case sensitive Note: if you are using BrowserStack and run out of minutes you have to choose the 'Automate ...


0

Is my understanding correct in that these tests should not be part of E2E? Yes it is. If a software team decides to forgo unit, integration, api, and other test types, then all testing is pushed to the UI. I've been on teams like this where the thought process is "all testing is the realm of QA, not developers." If a team takes this approach, automated E2E ...


-1

String source = "[[FirefoxDriver: firefox on WINDOWS (4520a9a1-c58b-4b34-ae3e-48613e6e7005)] -> xpath: //div[@class='page-title category-title']]"; //Split your Source from "->" String[] temp = source.split("-> "); //Split your Source from ": " String[] temp2 = temp[1].split(": "); //Access first index to get locator name String locator = temp2[0]...


0

you can go with BDD-cucumber .cucumber will provide you the custom tags by which you can easily divide your regression suite to multiple groups such as, @regression @sanity @high-level Example suppose i am having 1000 test cases in my regression and i have to do the only high-level testing or sanity check so while writing the feature file you can give ...


0

Let's suppose you have the situation where you have a page that loads a list of items names created in the last 24 hours, on the DOM tag ul#recent_items (ul with id recent_items). It will probably be implemented like: Frontend: (1) There is a component that represents this list, which makes a call to a service, organizes the data, and renders it nicely ...


0

You have to add the following experimental options: "profile.default_content_setting_values.media_stream_mic" "profile.default_content_setting_values.media_stream_camera" "profile.default_content_setting_values.geolocation" "profile.default_content_setting_values.notifications"


-1

I would find the locator of button on the popup. Then, You can surround the button click() in a try-catch block: try{ btn.click(); } catch(Exception e){ System.out.println("No Button Found"); }


0

Reason: This is a known issue for some time now. https://github.com/SeleniumHQ/selenium/search?q=ElementClickInterceptedException&type=Issues This exception suggests that there is another element (div below the button) will receive the click. Solutions: 1. Use another locator 2. Use Javascript executor driver.execute_script(JSCode,arguments) e.g. driver....


0

Please check this site https://www.swtestacademy.com/, they have amazing articles on various topics of test automation. This article demonstrate Selenium+Allure+TestNG in a very simple elaborate manner: https://www.swtestacademy.com/allure-testng/


0

The Python WebDriver API has a method for getting elements by name: find_element_by_name(name) https://selenium-python.readthedocs.io/api.html#selenium.webdriver.remote.webdriver.WebDriver.find_element_by_name


0

Try using JavaScriptExecutor C# IWebElement element = driver.FindElement(By.XPath("//button[@role='button']")); IJavaScriptExecutor jse2 = (IJavaScriptExecutor)driver; jse2.ExecuteScript("arguments[0].click()", element); Python element = driver.find_element_by_xpath("//button[@role='button']") driver.execute_script("arguments[0].click();", element)


-1

One example I can provide is for Jenkins. Not sure about the quality of the tests or the conventions used, as I am not a contributor, but the very fact how popular Jenkins is should prompt you to take a look how it's done: https://github.com/jenkinsci/acceptance-test-harness


1

It is not random. As you said: "It is basically company updates or any new feature release related" Feature flags solve your problem, by allowing you to select parts of the of the application to be included or not in a build, through configuration files, e.g. Thus, you only need to configure these updates to be display only on the environments they make ...


1

Assuming that you want to get the element "Echo Spot" from the Amazon.in page. WebElement ele2 = driver.findElement(driver.FindElement(By.XPath("//* [text()='Echo Spot']"));


2

You can try using the ThreadLocal Class, so each running thread would be assigned it's own webdriver instance. See pseudocode to get the idea: private static readonly ThreadLocal<IWebDriver> WebDrivers = new ThreadLocal<IWebDriver>(); public static IWebDriver Instance { get { if (WebDrivers.Value == null) { ...


-1

Id use an If statement on any page it can appear: If(pop is visible) { close popup(); } else{ }


0

XML code is working. If someone is facing issue with import part then use below Code:. import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.w3c.dom.Node; import org.w3c.dom.Element;


Top 50 recent answers are included