Comments (4)
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.
Hello Barancev ,
Thank you for considering this bug, please find the below steps to reproduce the bug
- open the URL "www.psprint.com"
- Click on Business Cards -> Standard business Cards Product link
- Click on Upload Now button
- Select a file with (.txt or .doc or .exe) extension
- 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.
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.
Hi Barancev,
Thank you so much, I got the issue it was related to AutoIt only. :)
Thanks,
Sunil
from selenium.
Related Issues (20)
- [🐛 Bug]: close method on Mobile Browser iPhone15/Safari does not close the browser window HOT 2
- [🐛 Bug]: PrintsPage method fails on Safari HOT 3
- [🐛 Bug]: deleteAllCookies method fails on Safari Driver HOT 3
- [🐛 Bug]: setWindowRect:true fails when passed to Browser Drivers HOT 2
- [🐛 Bug]: Not able to view Grid Dashboard with version 4.19.1 HOT 5
- [🐛 Bug]: Socks5 Proxy (Chrome) HOT 2
- [🐛 Bug]: Selenium is not opening chrome version 123.0.6312.124; error: could not start a new session. Response code: 500. Message: Session not created: This version of chromedriver only supports chrome version 114 HOT 4
- I have tried to run a node on the same machine as the hub and it connects fine HOT 1
- [🐛 Bug]: Grid endpoints fail to delete or drain a registered node HOT 4
- [🐛 Bug]: [Guice/ErrorInjectingConstructor]: SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally. HOT 3
- [🐛 Bug]: Click() function is not working while running the code but in debug mode it is working fine. HOT 17
- [🐛 Bug]: Selenium 4 grid execution shows different user's execution even when clicked using the correct session name HOT 3
- [🐛 Bug]: Selenium 4.4.0 | Chrome123.0.6312.106 | JDK 17|Timed out waiting for driver server to stop HOT 2
- [🐛 Bug]: driver.quit doesn't kill all Chrome processes HOT 14
- [🐛 Bug]: .NET LogFileHandler not writing any logs HOT 6
- [🐛 Bug]: Delete Cookies removes all cookies with the same name instead of deleting a provided Cookie HOT 1
- This is nuget that will make coding selenium simpler than ever!! HOT 3
- [🐛 Bug]: org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash from unknown error: cannot determine loading status HOT 2
- [🐛 Bug]: HeapProfiler.addHeapSnapshotChunk not fired in order HOT 1
- [🐛 Bug]: Driver info: driver.version: unknown HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from selenium.