I am testing some html that our developers wrote. Actually, I am evaluating selenium tests from another SQA and these tests test the HTML code.
In the web page you basically fill out a bunch of information, click next, review (sometimes there will be errors like a required field is missing, bad date, etc, and other times there will not be, such as when you correct the error and click next again).
after clicking next you click a link they have to go back to the previous page to make any changes, etc.
So the tests are basically
while [some expression]
fill out / change form
click *next*
examine results
click *return to previous page* to make changes
done
note return to previous page is NOT Chrome's <- (back) button but is a link on the page. The loop is executed many times. Not sure how many but > 5 and maybe > 10.
Anyway, at one of the later iterations, clicking next no longer brings up a results page and is just blank. My question, or what I wonder, is whether Chrome (or IE or whatever) stores all the visited pages in memory (while the back button may clear the page before going back or so) and is therefore running out of memory causing a blank screen. I should also note that the web pages use a lot of java script, and are being debugged with eclipse / selenium / testng.
So could this be what is happening? [please think of anything surrounded by asterisks as being in italics. Looks like it is not converting the font in my preview]
Related
I have found many older suggestions and solutions, none of which work as expected and many that just cause more issues.
Assume my web app allows users to create invoices and print them. These invoices may have any number of line items (even 100 or more). If the number of line items exceeds the page size, they are placed on the second page. This is fine.
What isn't fine is that if the second page should ever become separated from the first, it can get hard to tell which invoice it belongs to.
Is it at all possible (css, js, html, hacks, etc) to have a block of content repeat at the beginning of each and every paper page printed from a web page?
The linked possible duplicate question is from a few years ago and has no accepted answer, while the top answer doesn't actually work (as shown in the comments)
If at all possible create a PHP module and put it on every page inside of your web app. I've had to do this a few times.
If you want it to have an invoice number you can script it to start at 1001 and go up every time a function is completed. (A print button is selected)
May I suggest using page-break-after:. With page break you can control wherethe page breaks then re-insert headers.
I am replacing the showModalDialog function which no longer works in Chrome and FF. We have many applications using that. The problem is, pop up windows do post instructions to the web server and update the database. For instance if there's a list of accounts on screen and edit is clicked on one of the accounts, an edit page appears as a pop up, posts changes back to the web server, then the list is refreshed with changes. The entire list may be refreshed or just text that changed.
I made a javascript function to do pop up content using overlays. I thought it would be simple to replace showModalDialog calls with the javascript function, but I did not consider post instructions sent by the pop up page to update the database, and complexity to facilitate that. Posting can be done via ajax-like functionality, encapsulated in a set of functions. Before I start writing code to do this I'd like to know what other people have done in this circumstance. Thanks
I wrote some javascript to do everything I want. Since my pop up windows had javascript, I needed to run javascript upon rendering modal content, and also when the modal content went away. This will produce any number of overlays on top of each other, managing each. Content can optionally appear in a frame with a title bar, closely matching the functionality of showModalDialog.
Download at http://bikehappy.org/modal.html . If used, please give feedback saying if it works and provide update suggestions.
I need to sort messages, and I can either remove them or approve them (or ignore).
I want to create a script (probably using Tampermonkey - I'm using Chrome on mac) where I could input a list of recurring words (swear words I would input) for which it removes the messages so that it can go faster, it would automatically click the remove button after if it find the word(s) in the message.
If it doesn't find anything I want it to do NOTHING, just leave the page as is.
Basically usually after I click the button the page loads again automatically and gives me the next message.
I don't really know programming, I'm mostly just around html/css and a bit of jquery, but I'm learning here and there.
How can I achieve this ?
Thank you very much.
Context
Our web application has a feature for example "Create Employee". It shows three pages (1 of n) to allow user to enter relevant information on each page. On page 3, Save button allow user to save the employee. If user enter a incorrect value in a field on page 1 (something server can only verify) and server reports an error, the default behavior is to display page 1 with error message on top and the relevant field is mark as red.
Problem Statement
Above was all working until recent few build shows a breaking behavior. In above mentioned scenario, on error, the page 2 is displayed instead of page 1. Everything else is working fine like error message is correct, field on page 1 is marked red.
Analysis
I tried looking into pagination logic in java script, reverted back to version changes which was working. I also tried solution proposed here, here. I also cleared browser cache and reopen it.
Nothing worked.
Then I discovered major changes in UI code base was introduction of AntiForgeryToken(). I removed it from page and controller and everything worked again. I checked AntiForgeryToken() is not throwing exception.
Question
I am not sure how AntiForgeryToken() is affecting pagination code in java script?
What can I try to know more about the root cause?
Any proposed solution, remember, can not live without AntiForgeryToken()?
Thanks in advance.
Just in case it helps someone else who is novice like me in Java Script/JQuery.
The pagination logic in Java Script selects a page to display based on an index calculated through Index() method of JQuery and it considers number of form elements.
Since AntiForgeryToken() adds a hidden form element the index was wrongly calculated to 1 instead of 0 (for page 1). That was the role AntiForgeryToken() was playing.
The solution is to pass pagination group identifier to Index() method so it does not consider any other element than which belongs to pagination only.
That was it.
Learning from this problem, always be more specific while finding HTML elements with JQuery or any other JS library. JQuery did provide the means but unfortunately since things was working previously the original author did not utilized the power of Index() method.
No thoughts on this one? Anyone?
Here is my scenario:
I have a form where the user selects a report type, and then selects a list of users they want to generate reports for. When they submit the form, a new window is opened that uses pagination to allow the user to review each user report individual by using next and previous links.
The user wants the option to:
print both the currently displayed report by itself (that's an easy one), and
a "print all" option to print all the selected reports.
However, each report for each user must have its own "Page x of n" footer.
For the footer, I have been using the browser footer options, but in order to have the page numbering start new on each report printout, I have to make a separate window.print() call for each one. I have implemented this this way, and it works, but it's awful because each print() call causes a new print dialog to display, meaning the user has to click print in each dialog to finalise the print request. Many reports = a stupid number of popped up print dialogs.
Ideally, I would like the printing of a report group to look like a single print job, but I need that page count to be restarted for each report.
I thought of trying to count pages myself to make my own footer, but that seemed like a daunting task considering all the variables that could affect how many pages a report would occupy. I also read some about using ActiveX and WebBrowser objects to force prints and hide the print dialog, but I have had no success with that because I am running on XP SP2. Also, I understand it's frowned upon from a security perspective, and it's not a good cross-browser solution.
Has anyone dealt with printing of this type before and would have some suggestions for a way to make this work or a better way to handle it?
Thanks in advance.
I've seen this done two ways the simplist using the MeadCo scriptx component which alows you to print without a dialog. But as you rightly say this is not good from a security perspective. This was done in a corporate environment where they had control over the end users browser.
The second would be to go down the ajax route and load each report page individually, without prining, then concat each report html together into one doucment adding any needed page breaks. Finally rendering to an IFRAME and calling print on that frame to print all reports in one action.
This isn't tremendously helpful, but you may want to look into using a pdf generator, such as PDFlib or fpdf. Doing this with static pages will incur all the problems you stated, as well as some which you didn't (such as the user setting his own font or font size and ruining your pagination).