We have a an Automated suite that runs via Jenkins in a windows 10 machine (static slave). When executing we started encountering problems where in certain iFrames are not loading when running our scenario in headless mode via Jenkins. If we connect to the windows machine and execute the script in normal mode (with head) then it works completely fine. What could be the problem here ?
iframe:
<iframe _content-tfg-456="" heightadjustment="40" id="iframe-src" src="https://samplelink" style="height: 83.828px;"></iframe>
Chrome Driver options: (Added most of the options for debugging this issue)
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--test-type");
chromeOptions.addArguments("--lang=en_US");
chromeOptions.addArguments("--ignore-certificate-errors");
chromeOptions.addArguments("--disable-dev-shm-usage");
chromeOptions.addArguments("disable-popup-blocking");
chromeOptions.addArguments("disable-infobars");
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-setuid-sandbox");
chromeOptions.addArguments("--disable-notifications");
chromeOptions.addArguments("--verbose");
chromeOptions.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation"));
chromeOptions.setExperimentalOption("useAutomationExtension", false);
chromeOptions.addArguments("--headless");
chromeOptions.addArguments("--screenshots");
chromeOptions.addArguments("--user-agent=Chrome/90.0.4430.93");
//chromeOptions.addArguments("--remote-debugging-port=9222");
chromeOptions.addArguments("--window-size=1920,1080");
Map<String, Object> chromePrefernces = new HashMap<String, Object>();
chromePrefernces.put("credentials_enable_service", false);
chromePrefernces.put("profile.password_manager_enabled", false);
chromeOptions.setExperimentalOption("prefs", chromePrefernces);
return new ChromeDriver(chromeOptions);
Related
my blazor app seems to work but im trying to understand why I'm getting a 400error as seen in the screenshot.
Who can give me a HINT for what Blazor needs technically the "disconnect" ?
SCREENSHOT-disconnect
I'm running everything on a NGINX webserver.
thx Fabio
That call happens here in the code on the window unload event and is used to tell the signalr server that you are disconnecting.
If you are seeing a lot of these it may be that your proxy is not configured correctly for websocket connections.
window.addEventListener(
'unload',
() => {
const data = new FormData();
const circuitId = circuit.circuitId!;
data.append('circuitId', circuitId);
navigator.sendBeacon('_blazor/disconnect', data);
},
false
);
There's a bug reported for this issue here:
https://github.com/dotnet/aspnetcore/issues/30316
Blazor.server.js not respecting configureSignalR builder defined
url/path for disconnnects
As a work-around, I added this to Startup.cs in the Configure method:
var rewriteOptions = new RewriteOptions();
rewriteOptions.AddRewrite("_blazor/disconnect", "/_blazor/disconnect", skipRemainingRules: true);
app.UseRewriter(rewriteOptions);
public async Task<List<Tip>> GetTips()
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://APIURL ");
request.Credentials = CredentialCache.DefaultCredentials;
WebResponse res = await request.GetResponseAsync();
StreamReader sr = new StreamReader(res.GetResponseStream());
string result = sr.ReadToEnd();
List<Tip> tips = JsonConvert.DeserializeObject<List<Tip>>(result);
return tips;
}
I am working on a project which need to consume an enterprise Web API(Https) and display the data on Win 10 live tile, it’s an UWP application.
But I found it only works when I ran it in IDE(Visual Studio 2015 debug mode) .
When I created a package for this app and run it by powershell for installation, request.GetResponseAsync method throws exception “The login request was denied”.
I tried to check Enterprise Authentication and Private Networks(Client & Server) options in Package.appxmanifest. But there was no effect.
Any idea how to make it work normally? Thanks.
I have a Tridion Core Service Web Application to publish pages. When logged into the server and running it from there via a browser client calling a web service with ajax it works fine. However, when I run the application from my desktop it does nothing, and also throws no error messages.
*Edit:
The Web App hosting the web service is running as an 'Application' under the Tridion 2011 CMS website. This is done to avoid cross-domain ajax issues/
Update: The code below is working fine - both with the impersonate and also with Nick's solution. My issue was actually in how I was calling the web service from jQuery and using the appropriate URL. I am leaving the code and question so maybe it will help others.
My code is:
string binding = "wsHttp_2011";
using (var client = new SessionAwareCoreServiceClient(binding))
{
client.Impersonate("company\\cms_svc");
// ** Get Items to Publish
List<string> itemsToPublish = GetItemsToPublish(publishItem.TcmUri, client);
PublishInstructionData instruction = new PublishInstructionData
{
ResolveInstruction = new ResolveInstructionData() { IncludeChildPublications = false },
RenderInstruction = new RenderInstructionData()
};
PublicationTargetData pubtarget = (PublicationTargetData)client.Read(publishItem.PubTargetUri, readoptions);
List<string> target = new List<string>();
target.Add(pubtarget.Id);
client.Publish(itemsToPublish.ToArray(), instruction, target.ToArray(), GetPublishPriority(publishItem.Priority), readoptions);
}
Have at look at this page on SDL Live Content, which explains various types of scenarios for connecting as different users:
http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/task_87284697A4BB423AAD5387BBD6884735
As per the docs, instead of impersonation you may want to establish your Core Service connection as follows using NetworkCredential:
using (ChannelFactory<ISessionAwareCoreService> factory =
new ChannelFactory<ISessionAwareCoreService>("netTcp_2011"))
{
NetworkCredential networkCredential =
new NetworkCredential("username", "password", "domain");
factory.Credentials.Windows.ClientCredential = networkCredential;
ISessionAwareCoreService client = factory.CreateChannel();
Console.WriteLine(client.GetCurrentUser().Title);
}
I am trying to call HTTP request with network credential in blackberry. i have already implement on Java, Android it's working fine but not working on blackberry. Following step i have done in blackberry.
For set Network credential i have added three following jar.
commons-codec-1.6.jar
commons-httpclient-3.0.1.jar
commons-logging-1.1.1.jar
add this jar files are in blackberry project.
Following sample Code that work fine in Core Java.
try{
HttpClient client = new HttpClient();
GetMethod get = new GetMethod("http://www.google.com");
get.setDoAuthentication( true );
try {
int status = client.executeMethod( get );
System.out.println(status + "\n" + get.getResponseBodyAsString());
} finally {
get.releaseConnection();
}
}catch(Exception e){
System.out.println("Error:>>>>>>"+e);
}
Now there are not error on code but whenever try to click on application icon error face like "error starting appName: Module 'commons-httpclient-3.0.1' not found"
Can any one suggest what's this error say.
BB does not support HttpClient. But it does support J2ME's HttpConnection and is quite similar to HttpClient, so you can easily adjust with it. Here's some sample code to get you started:
try{
HttpConnection mConn = (HttpConnection)Connector.open(urlToPost);
mConn.setRequestMethod(HttpConnection.POST);
mConn.setRequestProperty("IF-Modified-Since", "20 Jan 2001 16:19:14 GMT");
mConn.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0");
mConn.setRequestProperty("Content-Language", "en-CA");
//---------------------------------------------------
mConn.setRequestProperty("User",usr);
mConn.setRequestProperty("pass",pass);
//---------------------------------------------------
catch(Exception e){//---handle your exceptions---//}
} finally {
mConn.close();//don't forget to close connections, only a limited number are available
}
This is a good article for beter understanding.
I got stuck in handling UntrustedSSLcertificates using web driver in Java.
I created firefox profile like:
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);
I created firefox profile, added overridden certificate.
This is not handling SSL certificates.
Is there any other way to handle UntrustedSSLcertificates?
//Firefox example with URL www.google.com
FirefoxProfile profile=new FirefoxProfile();
profile.setAssumeUntrustedCertificateIssuer(false);
driver=new FireforDriver(profile);
driver.get("https://google.com");
Eventually I found solution for Untrusted SSLCertificates:
ProfilesIni allProfiles = new ProfilesIni();
System.setProperty("webdriver.firefox.profile","your custom firefox profile name");
String browserProfile = stem.getProperty("webdriver.firefox.profile");
FirefoxProfile profile = allProfiles.getProfile(browserProfile);
profile.setAcceptUntrustedCertificates (true);
webdriver = new FirefoxDriver(profile);