How to remove version from the extent report - selenium

I am using the extent report in my selenium project ,i want to remove the version showing in the right corner of the report.
can any one help me on this.

Do you have a extent-config.xml file?
Find in there something that looks like this:
<styles>
<![CDATA[
]]>
</styles>
And add your custom css. You'll have to inspect the element you want to hide, to find a selector for it. And then you can add css, something like this:
<styles>
<![CDATA[
#id-of-the-element{display:none};
]]>
</styles>

Alternate solution:
You will find something like this in extent-config.xml
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
</scripts>
Simply make this change:
<scripts>
<![CDATA[
$(document).ready(function() {
document.getElementsByClassName("class name")[1].remove()
});
]]>
</scripts>

Related

CKEditor5 setData() stripping <code> tags

When I try to run
editor.setData("<p>test comment</p><code class=\"python-code\">def withCodeBlock:<br /> print('test')</code>");
The resulting editor contains the html:
<p>test comment</p>
<p>def withCodeBlock:
<br>print('test')</p>
It strips out the <code> tags, how can I stop this?
I found my issue, my sanitizer was removing a wrapping <pre> tag around the codeblock
editor.setData("<p>test comment</p><pre><code class=\"python-code\">def withCodeBlock:<br /> print('test')</code></pre>");
works perfect

Disable mouse right click in PDF

I am try to load an uploaded PDF file to my view file with an <iframe> tag, How can i disable the mouse right click in that specific <iframe> tag
My code is like this:-
<iframe id="your_iframe_id" src="http://localhost/employee/assets/documents/1582002009.pdf#toolbar=0&navpanes=0&scrollbar=0" onload="injectJS()" readonly="true" style="width:1000px; height:600px;" frameborder="0"></iframe>
<script type="text/javascript">
function disableContextMenu()
{
window.frames["your i frame id"].document.oncontextmenu = function(){alert("No way!"); return false;};
// Or use this
// document.getElementById("your i frame id").contentWindow.document.oncontextmenu
= function(){alert("No way!"); return false;};;
}
</script>
dont remember call this function too. if its not working tell me

How do I display SVG in .cshtml

I am trying to display .svg image on my .cshtml page.
Status404.cshtml
#inject Context Session
#{
Layout = "";
}
<img src="/workspace/src/Application/wwwroot/img/404.svg" alt="404page"/>
#if(Session.CurrentUser.Language=="ka"){
<p><ქართული ტექსტი</p>
}
#if(Session.CurrentUser.Language=="en"){
<p><ENG TEXT HERE</p>
}
RESULT:
I tried creating a partial view(renamed .svg to .cshtml) like 404Partial.cshtml and then including it in .cshtml like this :
#await Html.PartialAsync("/workspace/src/Application/Views/404Partial.cshtml");
But it couldn't find the view.
After looking at your folder structure, this is the tag and path you need to use
<object type="image/svg+xml" data="~/img/404.svg"> </object>
You can try use the Object tag instead.
<object type="image/svg+xml" data="path/image.svg">
</object>
There is another option for that:
#Html.Raw(File.ReadAllText(Server.MapPath("~/workspace/src/Application/wwwroot/img/404.svg")))

struts 2 dojo, can't load partial div tag?

Can anyone help me? I can't load div tag partially!
The flow, I run is like that:
When I click submit btn, it call imporUrl and go to action "import" and then call the importAction in ActionBean.
After that set 'AAA' and 'BBB' to the List.
Finally it is all working , but it reload the whole form, not only div, I want to reload only div partially. Please help thank !
<s:url id="importUrl" action="import">
<s:param name="id" value="%{id}" />
</s:url>
<sx:submit href="%{importUrl}" value="Import" targets="selectedDiv" />
String importAction(){
List.add("AAA");
List.add("BBB");
return SUCCESS;
}
<s:div id="selectedDiv">
<s:iterator value="List">
<s:property/>
</s:iterator>
</s:div>
I think you directly load the div on same page.But you have to do like this.
<sx:submit href="%{importUrl}" value="Import" targets="selectedDiv"
onclick="javascript:show_details();return false;"/>
And put javascript
<script>
function show_details() {
dojo.event.topic.publish("show_detail");
}
</script>
And make ur div tag like :
<sx:div id="details" listenTopics="show_detail" formId="frm_demo" showLoadingText="">
</sx:div>

Calling a method from XBL

From a XBL method, when I need to call another method, I do like:
<method name="myMethod_1">
<body>
<![CDATA[
// do staff
]]>
</body>
</method>
<method name="myMethod_2">
<body>
<![CDATA[
document.getElementById("thisElementID").myMethod_1();
]]>
</body>
</method>
I would like to know if is there a way to call the local method without need the element id? I've tried this.myMethod_1() but it says the method don't exist.
In the specific case of an event listener, there is another way around the problem, and that is to pass the element itself as the listener. Of course you only get one handleEvent method, so this is less useful if you're listening to lots of different events on lots of different event targets.
<implementation implements="nsIDOMEventListener">
<method name="handleEvent">
<parameter name="aEvent"/>
<body>
<![CDATA[
// do stuff
]]>
</body>
</method>
can you show us code calling myMethod_2? If you call it like: document.getElement(...).myMethod_2() that's fine, but if you have something like someElement.addEventHandler("click", myxbl.myMethod_2,...); that won't work since event target will be this.
This is important for determining what is this in that context
EDIT: (Tom's reply)
ow, think I got it.. it's exactly this the problem.. I'm calling it from a keypress listener of another document, and the "this" was not what I think..