Test new Tab for Windows Print menu

Discussions and Tech Support related to the iMacros Google Chrome extension.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.
Post Reply
destatez
Posts: 8
Joined: Wed May 28, 2014 5:19 pm

Test new Tab for Windows Print menu

Post by destatez » Thu Nov 15, 2018 3:19 pm

I'm trying to test a PRINT button that appears on a web page (I have over 2500 of these pages to test). What command(s) can I use to test the new TAB created from "clicking" the PRINT button as to whether the Windows print menu is brought up, or just a general html web page?

I'm running iMacros Chrome extension 10.0.5 on Chrome version 70.0.3538.102 with Windows 10.
chivracq
Posts: 7715
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Test new Tab for Windows Print menu

Post by chivracq » Thu Nov 15, 2018 5:17 pm

destatez wrote:I'm trying to test a PRINT button that appears on a web page (I have over 2500 of these pages to test). What command(s) can I use to test the new TAB created from "clicking" the PRINT button as to whether the Windows print menu is brought up, or just a general html web page?

I'm running

Code: Select all

iMacros Chrome extension 10.0.5 on Chrome version 70.0.3538.102 with Windows 10.
If I understand your Scenario and Reqs correctly, (always easier with a Script posted, and some URL to be able to have a look at the Page/Site...), you would first use the 'EXTRACT' Mechanism to check if the 'Print' Button appeared, maybe twice, first with 'EXTRACT=TXT' and then with 'EXTRACT=HTM' to make sure it contains all the "expected" 'onClick' JS...

Then to check that the 2nd Tab gets opened, a 'TAB T=2' will take you to that 2nd Tab if it exists (or your Script will stay on 'TAB_1' if it doesn't exist...), where again using 'EXTRACT' you can check on some HTML Element(s) belonging to that Print_Page if it/they is/are indeed present on the Page...

If you need to test 2500 Pages, I guess you'll want to close that 2nd Tab and not leave it Open (x2500, oops...!), required anyway, or the 'TAB T=2' would always work otherwise from Loop=2 where you might end up checking the Tab opened by the previous Run, but you'll need to close that 2nd Tab Conditionally...! (Or closing that Tab if it wasn't opened will actually close the TAB_1, and the whole Browser Instance with it, and your Script will then stop running of course...!)
You cannot use 'TAB CLOSE' for that as it cannot be made Conditional and is always executed...

Have a look at the "Interesting Threads of the Month" Thread for Septb or Octb 2018 where I recently included some older Thread about "Tab/Window Close" which contains a Listing of all Threads on the Forum about that Functionality and where at least one Syntax posted (by me) can be used for a "Conditional Close"... (although I think it has never been tested/confirmed on CR..., hum, and it needs the 'URL GOTO=javascript' Syntax, not completely sure either it is supported on v10.0.5 for CR...)

And I don't know about CR that I don't use, but on FF, you have some 'about:config' Setting where you can prevent the Browser from closing from a JS Script that might/should still prevent a 'TAB CLOSE' to close the Tab and the Browser if fired on TAB_1 and TAB_1 is the last/only Tab open. Maybe you have some similar Setting on CR... 8)
(Or you could do your whole Testing on FF, where I think "my" Syntax still works in v10.0.2 for FF, or in v8.9.7 for FF for sure..., + with or without the 'about:config' Setting...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
destatez
Posts: 8
Joined: Wed May 28, 2014 5:19 pm

Re: Test new Tab for Windows Print menu

Post by destatez » Fri Nov 16, 2018 6:17 pm

Thanks for all the discussion. Yes, I should have included 2 example links where 1 worked and the other didn't. For this application, I do not need to test whether the PRINT button is present, it always is. For each time that I click that button I ALWAYS get a new tab. My script will move to TAB 2 after clicking the button. Per your discussion, I need to find an html element that is always on the print page but never on the not going to print page. I've done some automation for a different button on each of these pages. The web pages are grouped in sets, where I generated 1 .iim file for each set and did TAB CLOSE between each web site. For this PRINT button script, I will stay on TAB 2 and do the TAB CLOSE before moving to the next site which will override TAB 1.
chivracq
Posts: 7715
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Test new Tab for Windows Print menu

Post by chivracq » Sat Nov 17, 2018 8:54 am

destatez wrote:Thanks for all the discussion. Yes, I should have included 2 example links where 1 worked and the other didn't. For this application, I do not need to test whether the PRINT button is present, it always is. For each time that I click that button I ALWAYS get a new tab. My script will move to TAB 2 after clicking the button. Per your discussion, I need to find an html element that is always on the print page but never on the not going to print page. I've done some automation for a different button on each of these pages. The web pages are grouped in sets, where I generated 1 .iim file for each set and did TAB CLOSE between each web site. For this PRINT button script, I will stay on TAB 2 and do the TAB CLOSE before moving to the next site which will override TAB 1.
Beh OK, I can't help you much further and be more precise than what I've already said in my previous Post without being able to have a look at the Page(s)/Site and how it behaves myself...

On a Thread with no Script and no URL I can only give some generic "if-if-if" Advice, and I usually stop at 2 'if'-Levels... 8)
Or it "feels" indeed otherwise like a "Discussion", oops...! :wink:

You get the "Precision" and "Quality" of Answer from the same "Precision" and "Quality" of Info you provide in your OP/Qt..., tja, sorry, I can't do better... :roll:
When I start a Reply to a Thread with "If I understand your Scenario correctly...", I'm already being "nice" to still try to answer the Qt... 8) , when I'm the Dev or Tester and get that kind of Reqs, if there is anything I don't understand exactly, they go back directly to the Business Analyst who designed the Reqs... :wink:
Last edited by chivracq on Mon Nov 19, 2018 4:28 pm, edited 1 time in total.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
Posts: 7715
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Test new Tab for Windows Print menu

Post by chivracq » Sun Nov 18, 2018 2:28 am

Hum, some little Precision...: Tab Navigation with iMacros has always been a little bit "tricky" as iMacros tends to lose the "Count" a little bit, with opening and closing Tabs, especially if Tabs are not opened by iMacros itself... And when looping a Script, 'TAB_1' for Loop_2 might not be 'TAB_1' for 'Loop_1'...

But next to firing a Conditional Tab Close when your Script knows "for sure" it's not on TAB_1, would be to use a "Trick" that I have already used and which consists, at the End and/or at the Beginning of your Script (for each Loop), for the Script to start (is already the Default) or go back to 'TAB_1' and to force a 'TAB CLOSEALLOTHERS' that will close any other (still) opened Tabs and will "reset" the Count to only 1 Tab open at that moment... And you probably wouldn't even need any Conditional Tab Close in that case..., and you avoid the "Risk" of the Script closing the Browser... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
Post Reply