Alexey R.
  • Member for 4 years, 5 months
  • Last seen this week
webdriver.chome() not callable or selenium.webdriver.chrome' has no attribute 'get'
1 votes

You need to uppercase first letter of "chrome" so that it would be web = webdriver.Chrome()

View answer
Why do we need to initialize Page Object class again in every Step of Cucumber scenario?
1 votes

Cucumber uses its own mechanism to instantiate objects (aka dependencies) which are referenced as glued classes fields or parameters of glued classes methods. It uses ObjectFactory that by default ...

View answer
I am stuck with null pointer exception in page object class
Accepted answer
1 votes

Here public WebDriver driver; LoginPage lp = new LoginPage(driver); You pass null to the constructor because driver field yet not initialized. The fact you later assign some non-null value to the ...

View answer
Cucumber - Accessing injected context in After scenario hook
Accepted answer
0 votes

Let's take this 10-minute tutorial from the official cucumber site. This does not show you how to deal with injection but I'll base my example on that. Say you have a context object defined like this (...

View answer
Is Cucumber Scenario equivalent to a Java Class?
1 votes

In cucumber to share states between steps you need to use DI mechanisms. Your steps definitions can be (and usually are) spread over several classes. Here you may find general concept description ...

View answer
Cant access elements in authentication popup that says ```sign in with google```
1 votes

That's actually quite an interesting case. First of all this code will work: import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support ...

View answer
When should we use Assert.true() instead of Assert.equals() method in Selenium?
0 votes

It is all about semantic.. Your tests should be logical and readable. If your criterion is boolean, there is no need to use complex constructions. That's much like when you use if. Instead of if(val ==...

View answer
Why dont we use the main() method in TestNG class?
0 votes

Entry point is always a main method. If you're using command-line to run your tests, you use org.testng.TestNG where there is a main method. If you're running tests from IDE or from Maven, there are ...

View answer
What is BrowserGetter in JUnit?
Accepted answer
0 votes

The structure of this course is arguable. As you can hear from the presentation (the link you mentioned in your comment) that class is a sort of Utility class that has been prepared by course ...

View answer
Why do HTML IDs need to be unique?
2 votes

My opinion is that technically it is hard enough to keep them really unique since part of a page could be a static template and another is generated dynamically. If browsers would treat id uniqueness ...

View answer
How to start Chrome in automation mode from command line?
Accepted answer
2 votes

Before you're doing new ChromeDriver() in your code, add these lines: System.setProperty("webdriver.chrome.logfile", "D:\\chromedriver.log"); System.setProperty("webdriver....

View answer
Seeing NullPointerException on running TestNG Selenium Framework
Accepted answer
1 votes

If you extend a class having driver field where that field is initialized do not add filed of the same name to child class. Doing that you're hiding a field of base class. Here is the example: Your ...

View answer
java.lang.NullPointerException,at ✽.Given product is set with the following fields(src/test/resources/features/wizard/wizardNewProduct.feature:
1 votes

You're not initializing your productRequest. So lines like: productRequest.setName(...); or productRequest.setProductTypes(...); obviously fail.

View answer
How are execution conditions and testing procedures traits of an test case for an unit test?
3 votes

Execution condition is actually the context of your tests (in common terms and in terms of specific frameworks like Spring, etc.). You can control it using so called Test Doubles (thanks to João ...

View answer
AttributeError: module 'selenium.webdriver.common.keys' has no attribute 'RETURN'
0 votes

See the documentation: https://www.selenium.dev/selenium/docs/api/py/webdriver/selenium.webdriver.common.keys.html instead of : from selenium.webdriver.common import keys search.send_keys(keys.RETURN) ...

View answer
Advice on API Mocking Tools
Accepted answer
3 votes

Depends on what your resources are you might want to use either online service like either https://www.mocky.io/ or https://www.mockable.io/ or https://get.mocklab.io/ (that is build on top of ...

View answer
Waiting for two events in Selenide
1 votes

You can keep existing approach. SelenideElement extends WebElement so that all existing conditional stuff will be working. Selenide does not have own cross-element conditions. Only the ones which are ...

View answer
Custom Test Case Name in TestNg HTML reports
Accepted answer
0 votes

You should use ITestResult to change the name of test in a report. For example this is the complete solution: Your dependencies: <dependencies> <!-- https://mvnrepository.com/artifact/org....

View answer
How do I create a BaseClass that adds logging messages?
2 votes

You should not implement WebElementFacade. Selenium supplies EventFiringWebDriver for such purpose. Using it you can add actions to take before and/or after any method WebDriver or WebElement provides....

View answer
Handling cases where a JSON Key exists or not
3 votes

You just get Response object from your call and do: public class Test { public static void main(String[] args) { Response response = RestAssured .get("https://mocki....

View answer
Avoiding a NPE when checking JSON response using JsonPath and Rest Assured
0 votes

Since the path returns a reference type you can just use the construction like this: if (response.path("priceTwo") instanceof Number) { vehicle.setPrice(response.path("priceTwo"...

View answer
Negative testing - delivering error when it should not?
1 votes

I do not see contradictions here. You have some definition of a valid input. Testing a valid input is defined as a positive case. (Those are basically the cases the system is designed for). There is ...

View answer
File transfer test cases for different OS's
Accepted answer
3 votes

Destination is a device (e.g. in Windows copy file.txt con) would print file to a console since con is console device Copy from one file system to another (for example copy from your local Fat32 to ...

View answer
How to verify if any key is having null value from Json response in rest assured(Just have to verify if in response null value is there)?
Accepted answer
1 votes

You can use Hamcrest matchers to verify that: package click.webelement.api.restassured; import io.restassured.RestAssured; import java.net.MalformedURLException; import java.net.URL; import static ...

View answer
TestNG: @BeforeMethod/@AfterMethod methods having no groups assigned are executed for the test method which have groups assigned
Accepted answer
1 votes

This is onlyForGroups description from the javadocs: Causes this method to be invoked only if the test method belongs to a listed group. It can be used if different setups are needed for different ...

View answer
How to retrieve test method status and other values in IReporter implementation
1 votes

For example using this way: class MyReporter implements IReporter { @Override public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) { ...

View answer
Checkbox gets unchecked even though the Code is written to only select the checkbox..can someone pls help
2 votes

The approach you are using works only with native check-boxes (i.e. <input type="checkbox"/>). What you have is a custom element that looks like a check-box and behaves like a check-...

View answer
Error with driver.switchTo().window() complaining that something isn't a string when it is
1 votes

Try to update your Appium build. Here is the issue discussed. Seems that you have old Appium. The latest one is 1.20.2. The problem is how Appium proxies the request from the Java client to the actual ...

View answer
How to check in the page if the name exists and then increment a unique name
1 votes

You have several ways to go: If your app is pure black-box Store what you already created in memory of your test. Example - parameterization that cucumber supplies. The downside is that when your ...

View answer
Getting java.lang.NumberFormatException: For input string: "517838839328"
1 votes

The maximum number you can parse to integer is 2147483647 while you're trying to parse 200 times bigger number Try to use Long.parseLong() instead.

View answer
1
2 3 4 5
15