Query reg Grid

177 views
Skip to first unread message

ashish sharma

unread,
Feb 28, 2021, 8:56:55 AMFeb 28
to seleniu...@googlegroups.com
Hey team,

I hope all is well with you.
I am facing issue in grid .. HTML file not opening in grid.. Could you please share any solution?

Thanks,
Ashish

--
Kind Regards, Ashish Sharma

⇜Krishnan Mahadevan⇝

unread,
Feb 28, 2021, 8:59:59 AMFeb 28
to Selenium Users
Ashish,

Can you please elaborate your query a bit more. What you have included is not sufficient for anyone to take a jab at this query.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAA1dHedLsY7F_VNFVQ_Y38OCPq-%3DX78ORTSJ8DtOc%2BGo3x4UAQ%40mail.gmail.com.

ashish sharma

unread,
Feb 28, 2021, 12:52:04 PMFeb 28
to seleniu...@googlegroups.com

Please find more information-
1. We are running automation test scripts in Jenkins.
2. We are using selenium + java framework .
3. We are trying to use Gridlastic for running our scripts in parallel.
4. Test step is to  Download pdf , convert into HTML and then verify elements.
5. Issue comes when we try to open HTML link using driver.get() .we need help at this Step.

Please let me know if you need further information to proceed?

Thanks,
Ashish 

⇜Krishnan Mahadevan⇝

unread,
Feb 28, 2021, 10:29:55 PMFeb 28
to Selenium Users
If I understand this correctly, you are using the selenium grid to do the following:

  • Using RemoteWebDriver, you are triggering a download pdf (which happens on a node)
  • You now want to convert this downloaded PDF into a HTML file (Is this already done or you are trying to do this as well. If its already done, then how did you manage to get this done ?)
  • Now on the converted HTML file, you would like to open it via RemoteWebDriver and then run some UI element check.
Please clarify on how exactly is the PDF being converted into a HTML ? Is your web application doing this or is it your automation code that is doing this ?
Please feel free to elaborate as much as possible on the PDF to HTML thing because its still not clear as to what are you trying to do.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

ashish sharma

unread,
Mar 1, 2021, 5:45:03 AMMar 1
to seleniu...@googlegroups.com
Hi krishnan,

Yes all your points are correct. Please find below automation code used to convert downloaded PDF into HTML. Looks like this code is working and pdf is converted into HTML .But I can not open the HTML file. Hope it's clear now and let me know if you have any solution?

File pdfFile = new File(pdfLocation);
System.out.println("pdfFile "+pdfFile);
System.out.println("pdfFile "+pdfFile.getName());
PDDocument pdf = null;

try {
pdf = PDDocument.load(pdfFile);
} catch (IOException e) {
e.printStackTrace();
}
Writer output = null;

try {
output = new PrintWriter(htmlLocation, "utf-8");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
try {
new PDFDomTree().writeText(pdf, output);
} catch (IOException e) {
e.printStackTrace();

ashish sharma

unread,
Mar 5, 2021, 7:42:02 AMMar 5
to seleniu...@googlegroups.com

Hey team , 

Any update on this please?

Thanks,
Ashish

Arvind Sah

unread,
Mar 5, 2021, 1:43:55 PMMar 5
to seleniu...@googlegroups.com
Hi, 

Can you please confirm jf your script is working on your local system.

Regards, 
Arvind

ashish sharma

unread,
Mar 5, 2021, 2:21:12 PMMar 5
to seleniu...@googlegroups.com
Hey, it does Not work on my local system as well when I use/ enable grid.

when I don’t use grid, My script works fine both on my local system and on server using Jenkins.

⇜Krishnan Mahadevan⇝

unread,
Mar 6, 2021, 12:59:28 AMMar 6
to Selenium Users
Ashish,

Please share the entire code snippet that starts off by getting the URL from the web page, downloads the PDF and then attempts at converting the pdf into html.

What you have shared as code snippet does not show us how you are doing the entire thing.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

ashish sharma

unread,
Mar 6, 2021, 6:11:56 AMMar 6
to seleniu...@googlegroups.com
Krishnan,
Do you have  any solution ? it looks like you keep asking questions instead of helping
Please find entire code below-
afPage.iDownloadReport();
afPage.iOpenHtmlReport(ReportFileName.FSBM);
@Step("I download  Report")
public void iDownloadReport() {
clickReportLink(ReportLinks.FSBM.getlistOptions());
navigateTo(getBaseURL() + "/apex/Report");
waitForInvisibility(loadingSpinner);
}

@Step("I Click Report Link")
public void clickReportLink(String report){
waitForInvisibility(selectListViewDropdown);
refreshPage();
waitForInvisibility(selectListViewDropdown);
WebElement reportLink = driver.findElement(By.xpath("//a[@id='" + report + "']"));
jsClick(reportLink);
waitForInvisibility(selectListViewDropdown);
}
@Step("I open the converted HTML report")
public void iOpenHtmlReport(ReportFileName fileName){
openHtmlReport(fileName.getlistOptions());
}
public void openHtmlReport(String reportName)  {
waitForInvisibility(loadingSpinner);

try {
waitForInvisibility(loadingSpinner);
pdfToHTML(downloadDirectory + reportName + ".pdf", downloadDirectory + reportName + ".html");
} catch (IOException | ParserConfigurationException e) {
e.printStackTrace();
}
String path = downloadDirectory + reportName + ".html";
driver.get("file://" + path);
}
public static String pdfToHTML(String pdfFilename, String htmlFilename) throws ParserConfigurationException, IOException {

String pdfLocation = pdfFilename;
String htmlLocation = htmlFilename;

File pdfFile = new File(pdfLocation);
    PDDocument pdf = null;

try {
pdf = PDDocument.load(pdfFile);
} catch (IOException e) {
e.printStackTrace();
}
Writer output = null;

try {
output = new PrintWriter(htmlLocation, "utf-8");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
try {
new PDFDomTree().writeText(pdf, output);
} catch (IOException e) {
e.printStackTrace();
}

    pdf.close();
output.close();
pdfFile.delete();

System.out.println(htmlLocation);
return htmlLocation;
}

Krishnan Mahadevan

unread,
Mar 6, 2021, 6:48:46 AMMar 6
to seleniu...@googlegroups.com
Ashish

The whole point of asking questions was to ensure that I understand what you are doing before suggesting some alternatives ( since you seem to share information only when asked questions )

The root cause of your issue is very straightforward.

You are clicking and downloading a report and converting it into a html inside the scope of a JVM. When it comes to a selenium grid this is not going to work because there are multiple JVMs involved.

But since you seem to somehow have issues ine asking you questions I am going to side step and let someone else answer you!


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

ashish sharma

unread,
Mar 6, 2021, 7:05:34 AMMar 6
to seleniu...@googlegroups.com
Krishnan,

You don’t have any solution that’s the real reason that you want to step side. Let’s be authentic here.
Stop blame game. If you don’t know that’s fine but atleast accept it and move on. 
Disheartening to see your unprofessional and rude behaviour.
After multiple follow ups What I get is more questions instead of any answer. 
Thanks!

Krishnan Mahadevan

unread,
Mar 6, 2021, 7:13:08 AMMar 6
to seleniu...@googlegroups.com
Ashish

If that's going to be a consolation to you, sure please feel free to imagine/conclude whatever you would like to.

Whether I would have the answer or not is not something that I have to prove/clarify here.

Blame games on a user forum is the last thing I would want to indulge in.

Just because you aren't getting a solution handed over to you in a silver plate doesn't mean that you vent out frustrations on a member of the forum.

So far I have been extremely professional in ensuring that I ask all information that is needed ( you can go back and look at each of your post. You started off with a one liner problem statement)


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

Sent from BlueMail

ashish sharma

unread,
Mar 6, 2021, 7:53:37 AMMar 6
to seleniu...@googlegroups.com
Long story short.. if you have solution what’s stopping you to provide?

What else information you need from me?

To be honest I don’t have solution that’s why I am reaching out to multiple 
people.You invited me to join this forum. I didn’t know even this forum existed. 
If you have invited me here, then talk with respect.
If you can’t talk respectfully and I don’t get solution to problem, I have to leave this forum for good.


⇜Krishnan Mahadevan⇝

unread,
Mar 6, 2021, 8:23:57 AMMar 6
to Selenium Users
I or anyone else on this forum will have a solution for you ONLY if you answer questions. You seem to be hell bent upon assuming that you have answered all questions.

Your code that you shared (looks like its cucumber based) does not tell us where exactly is the PDF report coming in ?

The below method 
@Step("I Click Report Link")
public void clickReportLink(String report){
waitForInvisibility(selectListViewDropdown);
refreshPage();
waitForInvisibility(selectListViewDropdown);
WebElement reportLink = driver.findElement(By.xpath("//a[@id='" + report + "']"));
jsClick(reportLink);
waitForInvisibility(selectListViewDropdown);
}
Shows that you are clicking a report, but is that the actual PDF report ? If yes then how are you even getting access to this PDF using Selenium because selenium cannot interact with embedded pdf content.

Your call to 

afPage.iDownloadReport();
is Just doing 

@Step("I download  Report")
public void iDownloadReport() {
clickReportLink(ReportLinks.FSBM.getlistOptions());
navigateTo(getBaseURL() + "/apex/Report");
waitForInvisibility(loadingSpinner);
}

which internally is invoking  
@Step("I Click Report Link")
public void clickReportLink(String report){
waitForInvisibility(selectListViewDropdown);
refreshPage();
waitForInvisibility(selectListViewDropdown);
WebElement reportLink = driver.findElement(By.xpath("//a[@id='" + report + "']"));
jsClick(reportLink);
waitForInvisibility(selectListViewDropdown);
}

So where exactly is the part wherein you are seeing a web page and doing something on the web page which results in a PDF even happening ?

But you obviously are not keen on providing information because you have already concluded that you have answered all questions and provided information.

I didnt invite you to any forum Ashish. I suggested that you post queries on a forum. Its hard to believe that a person who uses Selenium is NOT aware of what are the relevant forums wherein users typically ask questions (But hey, that's not my botheration).

I have so far ONLY conversed in a respectful tone. 

Now coming to the part of whether you want to be on the forum or NOT, is totally upto you on which I have no control whatsoever.

Long story short: The rules of this forum (or) any forum for that matter are very simple.

If you are NOT going to be sharing a Minimum Reproducible Sample for your post/question, the others on the forum are going to keep asking questions till that is available (or) till all information that is needed is present.

What you need to solve this on your OWN are to go through the below links:


To figure out where did your test run, you would need to either build the logic or use the library that I built for this purpose : https://github.com/RationaleEmotions/talk2grid#how-to-find-out-the-node-to-which-a-test-was-routed-to-

Once you have figured out all of the stuff and are now ready to upload a file to the node (this is what you would eventually need once you have your pdf converted into a HTML and ready to have it opened up )


With that I rest my case! Good luck with your issue!

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

ashish sharma

unread,
Mar 6, 2021, 9:10:09 AMMar 6
to seleniu...@googlegroups.com
Krishnan,
Stop beating around the bush And stop wasting my time and energy if you don’t know basics.

If you don’t have technical capability to resolve this , ACCEPT it. Stop sending rubbish questions ,replies and irrelevant links.

We can have screen share and discuss over call if you are mature sensible professional and really have solution.

I will still reply to your questions-

Yes I am clicking a report, and it is the actual PDF report. 

We are checking pdf content only after converting into HTML and not before that. 
The code that I shared with you actually downloads pdf , convert into HTML and opens it.

If you don’t understand simple selenium code then no worries you can still learn . May be you are novice person and trying to Learn selenium 
And out of interest trying to solve other people query. But you are really pain in the ***




Sachin Srivastava

unread,
Mar 6, 2021, 9:21:21 AMMar 6
to seleniu...@googlegroups.com
Asish, you are going below the belt. Krishnan had been of the active member in this group and has helped many folks. 

Well if you are so technically sound resolve the issue and post it as you contribution to the forum and stop mongering around. 

Krishnan, fact of the matter is that it's your energy and time getting waisted here. 








ashish sharma

unread,
Mar 6, 2021, 9:28:51 AMMar 6
to seleniu...@googlegroups.com

Hey Sachin,

Why are you interfering in between?
Mind your own business.. I can invite you both to call . Let me know and I will send meeting link. 
But I know  you won’t join call Because you are here to waste others time and write irrelevant stuff.

If krishnan had resolved other issues then it does not mean he is able to help or resolve the issue.

Sorry truth of matter is he has not provided any useful information to resolve this issue.


Sachin Srivastava

unread,
Mar 6, 2021, 9:34:58 AMMar 6
to seleniu...@googlegroups.com
Thanks for reminding me of my business. BTW with this attitude no one will come forward to help you. 

Well getting on call with you to solve YOUR problem is out of question now AND NOT GONNA HAPPEN. 



ashish sharma

unread,
Mar 6, 2021, 9:40:01 AMMar 6
to seleniu...@googlegroups.com
What attitude? I won’t take shit from any one here. If you provide solution then talk to me.
If someone keeps asking questions and not provide any solution then yes I am human and I will feel frustrated that my time and energy is wasted here. 
Look at yourself, you know nothing about matter , what’s happening Here, why somebody is writing here? 
You Come out of no where and start writing stupid things , why ? Is it you guys you can write and others are fool you can’t stand for themselves?


Martin Copjan

unread,
Mar 7, 2021, 12:49:06 PMMar 7
to Selenium Users
Dear Asish,

Selenium is an open source project, the way you acting here is like you would be paying big money for a licence which is not the case. If you are not happy with the answer provided, try to look for your answer elsewhere instead of insulting people who spent their time trying to help.
If you are working with Selenium actively there is a good chance that in future you may be stuck on a different issue. Who is going to help you then? No one wants to put up with toxic people.
Good luck to you on your PDF journey. 

ashish sharma

unread,
Mar 7, 2021, 1:05:52 PMMar 7
to seleniu...@googlegroups.com
Fuck off you bastards... 
To hell with your shitty group and you As well..

ddlionx

unread,
Mar 8, 2021, 3:07:01 PMMar 8
to seleniu...@googlegroups.com
Imagine working with or employing somebody like Ashish! Don’t let the idiots get you down Krishnan. 

Diego Molina

unread,
Mar 10, 2021, 9:26:36 AMMar 10
to Selenium Users
On the name of the Selenium project, I just want to thank all the ones who tried to handle the situation, who were friendly and professional in this forum. Specially to Krishnan who has always been an excellent and super helpful member of the community.

We will improve how this situations are handled and also ban folks who are being disrespectful to other members of the community.

Regards,
Diego
Reply all
Reply to author
Forward
0 new messages