Forum Posts

Oleg K
Jun 04, 2018
In Selenium Questions
Alex, Given I already have my sample selenium code library (which will not be anywhere complete until I do this week's homework and the final project) but it is in Java. I was thinking of also porting my code to C# at a small chance where I would need to use C# with Selenium. I can foresee a few blocks along the way of making such a port, but who doesn't like a little challenge? Does it make sense to make a C# version of the sample code and have it as a separate GitHub repository or it will be just a waste of time?
0
4
9
Oleg K
May 25, 2018
In Selenium Questions
Not sure if it is just me, but I come to see that WebDriver does not load pages completely each time the tests are run. I saw this during first homework exercises when details page sometimes failed to load the pagination (when it was there) during tests Here some examples from current homework exercises: Normal BestBuy homepage view: Failed ( no flyout) view: Normal search results view (with tabs): Failed view (no tabs): Not sure if it is WebDriver or Browser behavior and yes I used latest Chrome for these tests
WebDriver not loading pages completely each time content media
0
12
18
Oleg K
May 24, 2018
In Selenium Questions
Alex, I am done with all the Test Cases for 2nd week, but have a bit of concern about the "BestBuy Only" tab one . Basically, after selecting the unselected tab it takes a little bit for website to update total item count in the "1 - xx of ..." element through Ajax call or something I gather. This tells me that we have to delay checking if that element contains count from the actual tab In my custom class I have made a method for that purpose: public boolean elementTextContains(WebElement element, String value) { try { wait.until(ExpectedConditions.textToBePresentInElement(element, value)); return true; } catch (TimeoutException t) { return false; } catch (NullPointerException e) { return false; } } Now that doesn't work each time the test is run and makes test case fail until its run again and it is able to pick up the change in time Is relying on that specific ExpectedCondition a good solution and test case failing a little bit ok? OR am I just thinking too hard here and a victim of my own knowledge? The dirty solution for my issue I found is add a bit of delay in main test class method like Thread.sleep(500);
0
5
21
Oleg K
May 16, 2018
In Selenium Questions
I think a better solution to find the total number of results on the search results page would be using .split method of String ... for example: String stringA = "1 - 25 of 2276 items"; int numberOfResults = Integer.parseInt(stringA.split(" ")[4]);
0
3
14
Oleg K
May 16, 2018
In Selenium Questions
Not a question, but a quick friendly advice. When comparing two strings for equality ( as in homework Test Case 2 for title,subtitle and author) do not use == to check for equality, but use built-in String method .equals instead like: stringA.equals(stringB) Hope everyone is doing ok on the homework ;)
1
2
21

Oleg K

More actions