3

There are a number of different click and record applications out there that will then convert the process into code (of varying levels). How good they are at this often depends on how large a premium you're willing to pay in price, or other limitations. Selenium IDE SmartBear's TestComplete Telerik's Test Studio etc They often sound like a saving of ...


2

Testing real world objects comes up in interviews quite often. Interviews usually pick an object that everyone has seen and used before. Mostly, I've gotten "how to test a coffee mug or travel mug" question. Testing an ink pen is also common. While a bicycle might be the object, you are typically given something simple due to time constraints of the ...


2

I think you have covered testing on different 'levels' in great detail however testing also includes testing on different 'types' as well. One may think about security, performance, reliability & safety etc as important quality parameters to test an object on. I think you may easily relate it to an 'Bicycle' and come up with additional scenarios which ...


2

Drivers seems implementations of JavascriptExecutor. So it can be type casting. https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html . You could read more about this at the mentioned link


2

You can use assert 'https://***/news/' in last_url You can try it in Python console: >>> last_url = 'https://***/news/page.jsp' >>> assert 'https://***/news/' in last_url >>> last_url = 'https://***/no-news/page.jsp' >>> assert 'https://***/news/' in last_url Traceback (most recent call last): File "<stdin>", ...


1

It's hard to come up with the correct XPath locator without seeing the source code of the page you're trying to automate. Here are few hints: If the element is a <button> which looks like: <button class="favorite styled" type="button"> Search </button> the relevant XPath locator would be //button[text()='Search'] If the ...


1

You can use self.fail(msg="…").


1

There is no preferred language for Selenium. One of the good things about Selenium is that it is a language agnostic tool, which has allowed it to become popular and a web standard. I've been using Selenium since 2010 and have created many test automation frameworks. I've built automation frameworks in PHP, Java, C#, JavaScript. I have a computer science ...


1

There isn't any particular language that would be best for any framework. The tools and language used depends upon the organization you would work for ,thier policies and thier exposure to that languages or tool. Looking from a personal growth perspective, the best thing is to start searching for jobs in LinkedIn and other job sites and analyse there job ...


1

Here is the solution for index variable: Let's say, you have found 5 elements with same locator and you would like to perform action on each element by providing index number (Here, variable is used for index as "i") for(int i=1; i<=5; i++) { string xPathWithVariable = "(//div[@class='className'])" + "[" + i + "]"; driver.FindElement(By.XPath(...


1

Using MoveToElement you will be able to find or click in whatever point you want, you have just to define the first parameter, it can be the session(winappdriver) or driver(in other ways) which is created when you instance WindowsDriver. Otherwise you can set as first parameter a grid (my case), a list, a panel or whatever you want. Note: The top-left of ...


1

Instead of running the click straight away you can iterate over the results and see if they are suitable before clicking them. foreach (button in self.driver.find_elements_by_name("button_name")) if button.property == 'what i want' button.click() You can add other constraints on the button by adjusting the if statements. Nothing inside the ...


1

A picture would make it much easier to work out what exactly you are asking, however I'll assume it's alert messages (i.e. JavaScript popups). Selenium can work with those by using the Alert interface: e.g. Alert alert = driver.switchTo().alert(); // get the text of the alert alert.getText(); // click OK / accept the alert alert.accept();


1

You could use selenium to crawl the site for all link elements: private static List<string> GetLinksWithinElement(IWebElement element, IWebDriver driver) { HashSet<string> links = new HashSet<string>(); IList<IWebElement> listOlinks = element.FindElements(By.TagName("a")); foreach (var i in listOlinks)...


1

I personally wouldn't use Selenium to do this unless I had no other choice. It would be much more efficient to use a dedicated link crawler. That said, if I had to use Selenium, I'd do something on these lines (no guarantees on code correctness - I'm doing this from memory early in the morning): // First get all web elements with an href attribute List<...


1

"//button[contains(@class,'login-btn2')" Maybe it works. Try to find unique attribute.


1

As you have the Web Application so going with Selenium and TestNg is a better approach as there are lot or reference points available over the internet for same. Also since you have mentioned you have 600-700 test cases then i am assuming you must be doing some sought Data Driven Testing as well. You can design your framework with below approach : Design ...


1

How can you know in advance the amount of test cases you have to automate? Of course you can use selenium and testng if you’re targeting only ui tests but you should start at a lower layer instead, trying to validate the logic layer for example. UI can easily change and thus break.


1

Java's built in Function interface allows me to avoid using getters. Instead of hardcoding each property in a separate field, I use a TreeMap to hold all the properties as property name and property value. A second TreeMap links properties to scraping methods. The data type is String but I could also use a TreeMap as the value type within the first Treemap, ...


1

You are right to be concerned about getters/setters; they are an anti-pattern in OOP and should be avoided because they result in more tightly coupled code. Instead invert the responsibility by using the tell don't ask idiom. In this case use an expected data manager. Create a Batch class that reflects the expected data and pass this expectedData to the ...


1

// Find all rows with a class with TBLROW as sub-string List<WebElement> rowsWithName = driver.findElements(By.cssSelector("tr[class*=\"TBLROW\"]")); List<String> names = rowsWithName.stream().map(row -> // For each row row.findElements(By.className("TDOCLIST")) // Find all TDOCLIST cells ....


1

I have checked the first two results and the locator is same. So you can create a List of these elements by using FindElements method. And then put logic to create list of only matching Strings out of it.


Only top voted, non community-wiki answers of a minimum length are eligible