Are these two lines are same or different? - katalon-studio

I am new to Katalon Studio. I find this line to open a website:
WebUI.openBrowser('https://stackoverflow.com/questions/ask')
and also I find this line:
DriverFactory.getWebDriver().get('https://stackoverflow.com/questions/ask')
Are these two lines are same or different?

The main difference between these two lines is that WebUI.openBrowser() opens a new browser instance and navigates to the specified URL, while DriverFactory.getWebDriver().get() navigates to the specified URL using an existing browser instance.

Related

Generate multiple sheets in one pdf file

I am trying to generate a pdf from a Tableau workbook which has two sheets using the url method:
E.g: https://TableauServer/views/workbook/sheet1?:format=pdf&parameter=value
I am doing this in a program which will issue the url request to the url. The url works fine for one sheet. But the problem is how to generate one pdf file with both sheets in it?
If you first put your two sheets into a single dashboard and then use the URL for the published dashboard (still using the format=pdf parameter), this should work just fine.
We know it's possible because within the Tableau pages itself if you download a PDF it gives you several formatting options, including the option to put all the worksheets in a workbook into a single PDF.
I couldn't find any documentation on it though. What I ended up doing was looking at the network console in the browser (usually F12) when I downloaded the PDF from the browser by clicking the Download button. That showed me the URL end point and the JSON body the server expected in the request payload.
The endpoint URL wasn't too cryptic and ended with "commands/tabsrv/pdf-export-server". The challenge was to take the JSON in the request payload and find the right settings to get it into a single PDF.
This method is a more technical approach and requires very little coding skills; any language that has functions for http calls will work (I use python for it).
If you don't mind doing it outside a browser, tabcmd has lots of functionality to control PDF generation at the command line.

Opening OneDrive file in desktop Word

I'm trying to open a file for edit from Office365's OneDrive in desktop version of Word(I'm logged in with my Office 365 account) using ms-word protocol and I have noticed that there are several possibilities:
Sometimes file opens in edit mode, I can edit file and by pressing Ctrl + S save it directly to OneDrive without being prompted for any additional actions.
Sometimes file opens in Read Only mode, I can switch to Editor mode, but then when I try to save file I'm prompted to specify save location(default location is my OneDrive directory with this file).
Sometimes Word asks me to login to my Office365 account(even though I'm logged in with this account in Word), then opens file in Read Only mode and after it looks like 2nd case.
I would like to open it as described in 1st case so user doesn't have to make any additional actions.
My current scenario is:
User calls an API to create file.
API creates file in user's OneDrive using Microsoft Graph.
API returns direct URL to file and I open this file in Word using ms-word protocol.
By direct URL to file I mean: https://domain-my.sharepoint.com/personal/account/Documents/Apps/Microsoft Graph/appname/directoryname/filename.docx
URL to open file looks like:
ms-word:ofe|u|<file path specified above>
And as I described at the beginning there are 3 cases how file is opened and it looks randomly for me.
I have also noticed that when I open my file in Word Online(using web url to file) and then I press Edit in Word it uses exactly the same file URL I have created and returned to user but from here the file always open with 1st scenario.
Do you have any ideas why this behaves differently when I manually open file using ms-word protocol compared to Word Online using ms-word protocol with exactly the same url?
I would like to always open file from user's OneDrive in desktop Word in scenario when user doesn't have to make any additional steps to edit and save file back to OneDrive.
(I don't have reputation so I can't comment. I will try again with a partial answer.)
There is always a chance that the credentials will have to be refreshed, so there is no way to completely prevent Office apps from prompting for credentials but it should be relatively uncommon.
As to the issue of opening in edit mode vs protected mode: There are a variety of reasons why some files will open into protected view: https://support.office.com/en-us/article/What-is-Protected-View-d6f09ac7-e6b9-4495-8e43-2bbcdbcb6653
If you have a file that seemingly opens in edit mode vs some version of readonly or protected view, please use answers.microsoft.com where the conversation doesn't have to fit into the stackoverflow model.
when I open my file in Word Online(using web url to file) and then I press Edit in Word it uses exactly the same file URL
You suggest that the URLs are identical, but my first thought was that the difference may have been that the Word Online link uses the driveItem's webDavUrl property rather than baseItem's webUrl
https://learn.microsoft.com/en-us/onedrive/developer/rest-api/resources/driveitem#json-representation

Is there a way to programmatically open a server-side file in a new tab?

I'm running Jupyter notebook on a server and executing it from a client computer. In Rstudio server, one can programmably open a server-side file in a new tab via file.show. This is sometimes very convenient. For example, I have a script that processes a rather large image. Because of its size I don't want it to show directly in the output panel, rather I want to view it in a new tab. In Rstudio server I would normally do:
... image processing code ....
ggsave('temp.png')
file.show('temp.png')
This will automatically pop up the new image in a new tab once the script is finished.
Is it possible to do something similar in Jupyter?
I noticed that I could achieve this by clicking the image file in the built-in file browser, but I wonder if this could be programmed.
Similarly, is it possible to programmably open a webpage in a new tab like browseURL in Rstudio server? Note that webbrowser.open(url) doesn't quite do it because it tries to open a local browser, which in the server-client scenario will not open the new tab on the client side.
You can make a link. Relative URLs will open in a new browser tab. Files are served relative to the directory containing the notebook you are currently working on.
In Python:
from IPython.display import display, HTML
display(HTML('see image'))
Opening new tabs programmatically often triggers pop-up blockers, but publishing a link that the user clicks should be reliable.

Trying to get along with Interwoven

I am to create a new design (CSS & HTML) for a web site which is created using Interwoven ContentCenter Professional.
Now, I can see the existing files in CMS (Interwoven) but, I can't make changes. My changes are displayed only when I'm in edit mode. Nothing in the live page. I tried to submit, create editions of files but still no good.
How should I create or edit pages in Interwoven CMS?
Thanks.
If you're talking about generic pages, then once you are finished you have to click on the Generate option, then choose a directory and click Finish. Last thing you should do is to choose yeswhen it asks you to Re-generate the page.
What you are trying to do is just creating a new file, not generating a file from TeamSite's Formpublisher. It is just like if you are in Windows Explorer and creating a new file. In order to generate a file from a form entry, you need to be in the templatedata directory, ex: /default/main/branch1/WORKAREA/wa1/templatedata/category/type(on unix) or Y:/default/main/branch1/WORKAREA/wa1/templatedata/category/type (on Windows). There should be a file call datacapture.cfg there. There is another directory called data under the above path which stores your data content record (dcr) that are created from the form. This is the file that you can use to generate which will use the (tpl) file under the presentation directory.

WWW::Mechanize::Plugin::Display - Always open a new window

How can I configure WWW::Mechanize::Plugin::Display, so that the plug-in always opens a new window and not only a new tab?
The module uses HTML::Display for opening a browser, which in turn uses the environment variable PERL_HTML_DISPLAY_COMMAND for determining the command for opening a browser. So, if you want to use Firefox, for example, you can set that variable to firefox -browser %s to force opening a new window.
http://search.cpan.org/~corion/HTML-Display-0.39/lib/HTML/Display.pm
EDIT:
Sorry, this doesn't seem to work either. It opens a new empty window for each call to $mech->display, but also one tab for each call in which it then displays the content. Maybe you can find other command line options for Firefox or another browser that allows you to get the wanted behavior.
As an alternative you can configure your browser to always open new windows in new windows instead of new tabs (for Firefox: Preferences -> Tabs -> Open new windows in a new tab instead). If you want to keep that setting for your normal browsing, you can create an own profile for your Mechanize tests and add -P <your-test-profile> to your display command.