New answers tagged

2

Here's an idea: Install Linux. I recommend using a virtual machine such as VirtualBox, which can run on a normal Windows box, to install a popular, well-maintained and lightweight system such as Lubuntu or Bodhi. Using a virtual machine means that you can run it as an app on your Windows computer; and this method will shield both the host and guest machines ...


0

Please verify it within the chrome console with the following command: $x("yourxpat") This will show you how many elements are you getting, i know some friends uses the find by option instead of the console and they only show one by one and if it finds multiple it will fail.


1

Technology wise it depends on who might use it, we have developed test suites with protractor but they are rule out because there are no many automation tester who are adept with javascript. Go with the technology you or your team feel more comfortable with. edit: misread the question.


2

Fair warning: this is my opinion based on practice: if it does what you need and doesn't introduce too much of a maintenance burden, it's not bad practice. Your goal is to build scripts that a relatively easy to extend, relatively easy to debug, and relatively easy to maintain. If capybara works for you, then it's good.


0

Refer to this question: https://stackoverflow.com/q/34152390/6793637 chrome.window.onRemoved.addListener(), works only when a chrome process is running. The `driver.quit()` closes all the chrome processes. Use driver.close() or Could you try this : // Initializing instance of Firefox WebDriver driver = new ChromeDriver(); wait = new ...


1

1. you are not passing any driver instance to the Dashboard DashboardPage 2. You are trying to access local variable 'driver' which is not initialized yet Solution: Add : public void launchapp() { driver = new Setup().initializeAppiumServer(); } Or pass the already initialized driver to the dashboard: in your dashboard class also or pass ...


0

I can figure out these things 1- You have not instantiated pageFactory in LoginPage class. Please do it using below public LoginPage(WebDriver driver){ PageFactory.initElements(driver, this); } 2-In loginToCRM class create object of LoginPage as given below. LoginPage loginpage = new LoginPage(driver); 3-Can you also try in ...


0

I came across this issue building a test suite for our own application which uses the Angular JS Framework. Using the following helper functions: private IWebElement FindElementWithWait(By id, int timeout) { bool found = false; int loop = 0; IWebElement element = null; var i = timeout * 10; while (!found && ...


0

You can do it in a simple way. Read the data from CSV and store it in data provider and after that and while writing test pass it as parameter. Below is just an example . @Test(dataProvider = "TestData",priority =1) public void RI_Employer_Information_page(String url,String client) { driver.get(url); WebElement linkclient = driver....


0

It is always a good practice to run each cases separately. But in some cases you may add dependency of one test on another one. For example there are two tests 'TestA' and 'TestB ' . If you add dependency of 'TestA' on 'TestB', then in this case 'TestB' will only execute if 'Test A' is passed. @Test(dependsOnMethods={"testA"}) testB(){ }


1

Since you are just getting started with your test automation journey, imagine you are given an application and some test scenarios to automate. You use your knowledge of Selenium and TestNG and you start creating few Classes and Methods to perform operations on the UI controls as per your test cases. Using TestNG you manage to execute those tests and you ...


0

Did you try driver.close()? Quit() kills the browser, which probably does not give it the chance the trigger the events. Close() closes the active window but the browser stays open, although if it is the last window it might quit aswell, maybe you need to open an extra window first.


2

As a shorter way, Its a base structer or the foundation to write automation test scripts for different componets (web, mobile ... etc). A good framework will provide solutions for some of below limitations or the issues. Handling scripts and data separately. Creation of libraries. Extensibility issues. Maintenance issues. Reporting issues.


-2

I would not go for any long answer here as I know during your struggling phase you would have come across multiple stuff like that. I will simply suggest a short solution that worked for me and further landed me in a product based MNC company with an awesome package. I understand you have limited knowledge but don't worry. IT employees with limited coding ...


4

I think you are missing out the definition of "Framework" https://smartbear.com/learn/automated-testing/test-automation-frameworks/ A framework is comprised of a combination of practices and tools that are designed to help QA professionals test more efficiently. These guidelines could include coding standards, test-data handling methods, ...


11

my colleagues suggest me to learn and create a fully functional - generic framework which any team can use? I suggest you don't. Your coworkers suggest you to start over-engineering. It is fine to experiment. Automate a test, automate another one. Maybe a reusable abstraction emerges. Maybe this becomes a reusable framework. Practise the YAGNI (You aren'...


0

Simple answer (but a lots of maintenance in the future): Create IncognitoBaseClass which extends BaseClass, override method instantiateChromeDriver() and make your TestClasses derive from one of them. As you want them. Complex answers (one of them might be good): Create different packages for those tests, and use one for IncognitoTests and secon one for ...


2

Are there any courses/books online to learn automation framework design in Java? In my case, I started learning with online videos about Java (focus in selenium). In my case, it was more helpful (and to be honest more convenient to learn via online video tool) I started with the link from Angie Jones Courses. There you will find good online videos. Also ...


2

I think the first sentence on Wikipedia says it clearly enough: In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by additional user-written code, thus providing application-specific software. [ https://en.wikipedia.org/wiki/Software_framework ] To say it in ...


1

I've never done with with Python, but, have a few times with C#. I know you won't be able to copy/paste this, but, will maybe help point you in the right direction string cookieNameString = _driver.Manage().Cookies.GetCookieNamed("actualCookieName").Value; cookieNameString = "my new cookie value"; Cookie actualCookieName = new ...


0

You could use xPath to find the column using the text from the first column. So something like this would work: //tr[td[contains(text(),'Cash Deposit (including online)')]]/td[2] That will look the cell in the second column, where the first column is equal to the relevant text.


2

You can override you private void instantiateChromeDriver() method in your child class (you have to change access modifier of the method in base class in order to do so) where you can instantiate the driver with the options you need in your child class. Here is a simple model of your architecture: Base class with its own initialization public class Base { ...


3

You are trying to access element instance that was created using the previous browser instance. The workflow is as follow, You imported the page object instance at the start of the spec using require A browser instant is created in the onPrepare Using that instance your page object model gets the element object But on next 'It' the browser restarts but the ...


0

To resolved this issue ensuring that all PageObjects, were properly re-initialized before each test. It ensures that the ElementFinder properties are using the current browser session. Below is code snippet to initialise a page object before each test. beforeEach(() => { //Ensure that we initialize the page object before every test as we ...


1

I realized I needed to instantiate a Remote Web Driver in order to obtain functionality remotely. Solved. if(browser.driver instanceof RemoteWebDriver) { new FlashPolicyHelper((RemoteWebDriver) browser.driver).addSite(odysseyURL) } browser public class FlashPolicyHelper { private final RemoteWebDriver driver; public FlashPolicyHelper(RemoteWebDriver ...


1

Recently I have automated 2-factor authorization for our organization. Although it is not simple. Once you will do login on the second layer you have to get OTP from google auth service or other similar services OR through Mobile SMS. OTP we received on the second layer is, TOTP stands for Time-based One-time Passwords and is a common form of Two-factor ...


2

It should be something like this one (might need some adjustments if you use something other than IntelliJ as your IDE and : # Created by .ignore support plugin (hsz.mobi) ### Java template *.class # Mobile Tools for Java (J2ME) .mtj.tmp/ # Package Files # *.jar *.war *.ear # virtual machine crash logs, see http://www.java.com/en/download/help/...


1

I am.not sure what you are trying to do . Instead saying a div or input. Explain it in simpler terms like a text box or placeholder or button etc . So that everyone understands the use case Coming to your question : It seems like , u want to find a div element and verify it is disabled What you are doing in the test is , getting all non editable ...


3

Add an explicit wait after you click your menu and then once the drop-down element is present refer below steps: https://selenium.dev/docs/site/en/support_packages/working_with_select_elements/ Please refer to the above document: You can use the select class in ruby to achieve this: select_element = driver.find_element(id: 'couCode') select_object = ...


1

You can implement your page object as polymorphic interfaces, so your tests will run the same commands, but the underlying code is dispatched in runtime to the specific behavior. interface LoginPage { fun login(); } class MobileLogin implements LoginPage { fun login() { ... } } class WebLogin implements LoginPage { fun login() { ... } } Then ...


6

Some options in my order of preference: Probably you do not want to test the TwoFactorAuth, but you want to test the application behind it. Consider building a backdoor which is only enabled in the test environment, so that you can bypass the TFA. Generate the OTP from code with OTP.Net: https://dev.to/j_sakamoto/selenium-testing---how-to-sign-in-to-two-...


1

I have tried this code for Google.ca and it worked: driver.get("https://www.google.ca/") String color = driver.findElement(By.id("gsr")).getCssValue("background-color"); System.out.println(color); Output: rgba(255, 255, 255, 1)


0

I think the issues are in the url, try to use a prefix like http:// or http://.


6

You can either: Look for all element that match certain search criteria: if driver.find_elements_by_css_selector(my_locator): # No element found here Catch an exception when searching for a single instance: try: webdriver.find_element_by_css_selector(my_locator) except NoSuchElementException: # No element found here


0

One way to solve this would be to set up a custom chrome profile in which you disable the download prompt, save it to a specific location inside your project, then use to pass as an argument to ChromeOptions. var options = new ChromeOptions(); options.AddArgument("--profile-directory=AutoUser"); or options.AddArgument("--user-data-dir=C:/Users/...


0

Yes you can achieve this using profile: Just login to the system and save the login session, you can get profile folder by typing chrome://version in tab: Open path\Google\chrome folder goto user data folder Copy the path to Default folder Now set it in chromeoptions: chromeOptions:{'args': ['--user-data-dir=%yourpath%\\Local\\Google\\Chrome\\User Data'...


3

Hi you could try converting the local text to Unicode values first, use the below website to do that: https://www.branah.com/unicode-converter So the unicode character for : הוסף תמונה או סרטון is \u05d4\u05d5\u05e1\u05e3 \u05ea\u05de\u05d5\u05e0\u05d4 \u05d0\u05d5 \u05e1\u05e8\u05d8\u05d5\u05df Now use that value in your xpath: a=driver.findElement(By....


1

There are multiple reasons for that. But first let's fix this code first: class LoginPage(){ WebDriver driver; //here you have global variable for this page object public LoginPage(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); } } You will want to have access to driver instance. ...


1

Why [4]? Shouldn't it be: string xpath = "//article[@class='shared__reader__xx reader__container__content'][1]/div[@class='chapter xx'][1]";


0

You can use the following method to clear text fields, it is tested on different types of input fields public boolean clearTextField(Object locator) { _element = _query.castLocator(locator); if (toBeCleared(_element)) { _element.clear(); } if (toBeCleared(_element)) { _mouse.click(locator); // simulate select all text ...


0

I don’t know you are still looking for solution or you have solved it. You can give it a try with click using Javascript. Click with java script doesn’t depends on that element is loaded properly in DOM or not. So no chance of timeout but you can use Thread.sleep(5000); for give sometime to load DOM. Explicit wait can throw timeoutException. If there will ...


3

Your xpath locator is wrong , try the below xpath: /html/body/div/div/footer/md-toolbar/div/div[2]/img[2]/../../../../../../../../body[@class="layout-column md-dialog-is-showing"] The errors were , space after /html/body/div/div/footer/md- more than one space character after body[@class="layout-column You navigated back to parent only seven times, ../../...


23

Why test in IE5 if the customer isn't using it? It doesn't sound like they actually want IE5 support. They just want it to work. Test in IE11 Compatibility mode, as that's what they use.


5

There is no way to automate this in a way comparable to your current method. This is due to the lack of comparable automation APIs and basic action feedback. It is possible to manually test this by setting up virtual machines, this can still be done, even for Windows 95, etc. This will not work on public clouds or popular commercial hypervisors but can be ...


0

Put a breakpoint on this line: WebElement message = driver.findElement (By.xpath("//*[@id='NoChainFound']")); In the browser window, that selenium opened press F12, then type in the console: document.querySelector("#NoChainFound") If the result is null: Switch the iframe and try the query again, like this: The website might require some other user ...


4

There are solutions for IE6 and higher, but great scott - IE5 is out of reach, for sure for automated tests. I've found something like this: https://netrenderer.com/ but it doesn't even support https.


16

Another approach (or part of one). Before proceeding ask for a sign-off on a document that clearly states the security risk this presents to the organization and its customers and that they acknowledge that risk. This might get more attention, though it is obviously a little aggressive (or may be perceived to be that way). Adjust approach as needed for ...


15

Given that the customer insists, I'd recommend using a virtual environment with IE5 installed, and then search for automation solutions that can work in that environment. This will be a challenge: you will need something that can operate on the elderly operating system (I think XP can run IE5, but I'm not sure about anything newer) and preferably something ...


11

Look around on the internet, e.g. ebay, for Windows machines that are 15-20 years old. I don't like this answer but given the crazy situation I am suggesting it.


0

Your css locator is wrong: driver.FindElement(By.CssSelector("class[onclick='gotoReportView(20, 'ReportSectionc5404625cccfdb7d5563')']")).Click(); driver.FindElement(By.CssSelector("Span[onclick='gotoReportView(20, 'ReportSectionc5404625cccfdb7d5563')']")).Click(); The format for css locator is , tag[attribute='value'] tag.classname tag#id Tag>Tag (...


Top 50 recent answers are included