Code Monkey home page Code Monkey logo

Comments (4)

barancev avatar barancev commented on May 12, 2024

Please provide a complete executable scenario to reproduce the issue instead of narrative description of the actions like "When I try to click on any product e.g "Business Card""

from selenium.

SunilGhargaonkar avatar SunilGhargaonkar commented on May 12, 2024

Hello Barancev ,

Thank you for considering this bug, please find the below steps to reproduce the bug

  1. open the URL "www.psprint.com"
  2. Click on Business Cards -> Standard business Cards Product link
  3. Click on Upload Now button
  4. Select a file with (.txt or .doc or .exe) extension
  5. Click on Open button ( to upload selected file) and observe

Expected Result: An Error popup should display for invalid files

Note: Below code with xpath

public static WebDriver openfirefox;

@test(priority = 1)
public void openLink() {
openfirefox.get("https://www.psprint.com/");//Opens the URL
}

@test(priority = 2)
public void businessCard() {
WebElement products = openfirefox.findElement(By.xpath("/html/body/div[1]/div[2]/div/ul/li[1]/a"));// Hover over products link
Actions action = new Actions(openfirefox);
action.moveToElement(products).build().perform();
openfirefox.findElement(By.xpath("//[@Class = 'has-dropdown']/div/ul/li[1]/ul/li[4]/a")).click();//Clicks on Business Card
openfirefox.findElement(By.xpath("//
[@Class = 'section-content clearfix']/div[1]/div/a/div")).click();//Clicks on Standard Business Card
}

@test(priority = 3)
public void uploadImage() {
if(isElementPresent(By.id("fileupload_front1"))) {
upload("front");// Passing the argument to upload method
}
}

private void upload(String side) {
WebElement error = openfirefox.findElement(By.xpath(/html/body/div[11]/div[2]));
if(side == "front"){
openfirefox.findElement(By.id("fileupload_front1")).click();// Clicks on Upload now button

    if(error.isEnabled()) {
        System.out.println("------Invalid file type has been uploaded.----");// Prints invalid file upload
        openfirefox.findElement(By.xpath(Constant.CloseError)).click();//Close the error window
    }
}

}

from selenium.

barancev avatar barancev commented on May 12, 2024

I've executed the same scenario with Selenium, but uploaded a file by hands instead of AutoIt -- the error box appears. So the issue is related to your AutoIt script, not Selenium.

from selenium.

SunilGhargaonkar avatar SunilGhargaonkar commented on May 12, 2024

Hi Barancev,

Thank you so much, I got the issue it was related to AutoIt only. :)

Thanks,
Sunil

from selenium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.