Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Shachen Han

Greenhorn
+ Follow
since Oct 07, 2015
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shachen Han

I see, thanks a bunch I have a better idea of what to do now.
6 years ago

Winston Gutkowski wrote:I'm afraid that's a very vague description. What output? From where?



My program is supposed to take screenshots from a webpage as well as obtain the page source of the webpage (I am doing this with Selenium WebDriver). The outputs I am expecting are the screenshots and page source that the program has obtained. It will be stored in the project folder the user has specified. Through the program, the user can view the images and page source in text.

I presume then that they can only have one "open" project at a time.



Yes, I only intend to have one project at a time.

Thanks for the suggestion, I have looked it through. So how is the project / folder management usually carried out? What's the workflow behind it? Do I create property files for each project to track the given information? Do I also need to create my own project file extension to be opened for my particular program? I see this is the case in many other programs such as Word or Photoshop.

6 years ago
I am writing a program which is able to take screenshots of a webpage and obtain the page source.

I am not sure about the term that is used but I want to be able to perform some project / folder management.

The user can start a new project, which will obtain the project name, path, user name, and the user email.
All output created will be stored in the path with the specified project name as the folder name, and the user can view all output generated. I want to be able to email the user as well for a future feature.
The user will be able to open another project, and close the current one.

I know I can store information permanently through using Properties or a text file so I can generate a file for each project to save the user's information, but I want a clearer idea behind how this is usually achieved. Any pointers?
6 years ago
Is anyone here familiar with Sikuli?
I am using Sikuli to detect videos on a webpage, and to check if the video has ended.
I have tried 2 different ways of going about this.

The first method is using the event handler in Sikuli.
The event handler will detect for changes in a region (which is an area on the screen that I've declared). When there are changes on the screen (a minimum 50 pixels change), it will print 'Video playing'.
The thing is, if there aren't any changes, the event handler will not do anything. I want to be able to detect when there are no longer any changes on the region and be able to stop the observer.



The second method that I've tried is by comparing my region (which is my active web browser window) to a screen capture of the region I have taken while the video is playing.
If it doesn't match, that means the video is still playing and I will take a new screen capture, which will be run through the while loop again for comparison.
If it matches, it means the video has stopped and will exit the while loop.
It works when it first goes through the loop. The while loop returns null which means the video is playing. However, on the second time it loops, it will exit the while loop and tell me my video has stopped but it clearly hasn't.

Is my logic flawed?



A solution to either method is fine, the end goal is to be able to detect when a video has ended.
6 years ago

Campbell Ritchie wrote:… and welcome to the Ranch

Moving thread as too difficult for this forum.



Glad to be here


J. Kevin Robbins wrote:I think you'll find that you are getting the screen capture, but it's overwriting the previous file. Consider for a moment; how often is your datetime String changing?



You're right, I can't believe I overlooked that... It works fine now that I placed it into my method. Thanks for the help!

6 years ago
Hmm, the logger isn't throwing any errors.
6 years ago
Hello.

I am using Selenium WebDriver to perform some webscraping. Based on the website URL given by the user, Selenium will bring up the website, and take a screenshot.

I've also added an interval feature, such that every 1 minute or whatever timing the user has selected, the script will re-visit the website again and take a screenshot.

All these output are saved to a directory specified by the user.

The first time round I run it is fine. I received my screenshot in the directory I specified.
After 1 minute, the script will start up again and everything seems to be running normally, but the directory is missing the additional screenshots.

What am I missing here?



I'm using the NetBeans GUI Builder for my form.

6 years ago